User stochazesthai - Quantitative Finance Stack Exchange most recent 30 from quant.stackexchange.com 2019-09-15T09:43:25Z https://quant.stackexchange.com/feeds/user/19515 https://creativecommons.org/licenses/by-sa/4.0/rdf https://quant.stackexchange.com/questions/24638/linear-regession-3-methods-different-results/24640#24640 3 Answer by stochazesthai for Linear Regession 3 methods different results stochazesthai https://quant.stackexchange.com/users/19515 2016-03-01T10:05:16Z 2016-03-01T10:05:16Z <p>It is a common problem due to floating point arithmetics. For example you cast variables to double type, whereas Excel uses a limited precision.</p> <p>Here you can find more info about the numeric precision in Excel: <a href="https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel" rel="nofollow">https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel</a></p> <p>I don't know anything about NinjaTrader, but I think the results are slightly different from your implementation because of the precision used.</p> https://quant.stackexchange.com/questions/24606/why-is-nd-2-not-needed-for-hedging/24607#24607 7 Answer by stochazesthai for Why is $N(d_2)$ not needed for hedging? stochazesthai https://quant.stackexchange.com/users/19515 2016-02-28T19:24:31Z 2016-02-29T07:01:23Z <p>The point is the following:</p> <p>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.</p> <p>So, given that the value of a call option for a non-dividend-paying underlying stock in terms of the Black–Scholes parameters is</p> <p>$$C = N(d_{1})S - N(d_{2})Ke^{-rT},$$</p> <p>$$\Delta = \frac{\partial C}{\partial S} = N(d_{1}).$$</p> <p>Basically, Delta is just the first partial derivative of $C$ with respect to $S$.</p> <hr> <p><strong>How to derive $\Delta$</strong></p> <ul> <li>$N(x)$ is the cumulative probability that a variable with a standardized normal distribution will be less than x;</li> <li>$N'(x)$ is the probability density function for a standardized normal distribution:</li> </ul> <p>$$N'(X) = \frac{1}{\sqrt{2\pi}}e^{\frac{x^2}{2}}.$$</p> <p>Then, defining $\tau = T - t$, we have $$d_{1} = \frac{\ln(\frac{S}{K}) + (r + \frac{\sigma^2}{2})\tau}{\sigma\sqrt{\tau}}$$</p> <p>and </p> <p>$$d_{2} = \frac{\ln(\frac{S}{K}) + (r - \frac{\sigma^2}{2})\tau}{\sigma\sqrt{\tau}}$$</p> <p>It follows that</p> <p>$$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}$$</p> <p>Thus,</p> <p>$$N'(d_{1})S = N'(d_{2})Ke^{-r\tau}.$$</p> <p>Then</p> <p>$$\frac{\partial d_{1}}{\partial S} = \frac{\partial d_{2}}{\partial S} = \frac{1}{S\sigma\sqrt{\tau}}$$</p> <p>Since there is an $S$ in $N(d_{1})$ and $N(d_{2})$, we use the chain-rule:</p> <p>$$\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}).$$</p> https://quant.stackexchange.com/questions/24602/-/24603#24603 1 Answer by stochazesthai for Calculate total risk stochazesthai https://quant.stackexchange.com/users/19515 2016-02-28T17:52:25Z 2016-02-28T17:52:25Z <p>Notice that the problem does not give you a risk-free investment, so the computation of the Sharpe ratio becomes:</p> <p>$$SR = \frac{E(r)}{\sqrt{VAR(r)}}$$</p> <p>Year 1:</p> <p>$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$</p> <p>$\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$</p> <p>$SR = \frac{2}{4} = 0.5$</p> <hr> <p>Year 2:</p> <p>$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$</p> <p>$\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$</p> <p>$SR = \frac{6}{12} = 0.5$</p> <hr> <p>Year 1+2:</p> <p>$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$</p> <p>$\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$</p> <p>$SR = \frac{4}{9.165} = 0.436$</p> https://quant.stackexchange.com/questions/24595/-/24598#24598 5 Answer by stochazesthai for Why are investors risk-averse? stochazesthai https://quant.stackexchange.com/users/19515 2016-02-28T11:16:09Z 2016-02-28T11:16:09Z <p>Below you find some observations...</p> <blockquote> <p>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?</p> </blockquote> <p>The "rational investors" 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). </p> <blockquote> <p>Consider the following example, suppose investment $i$ as an expected return of 10% and beta coefficient 2 while another safer investment offers 5% but is virtually risk free. </p> </blockquote> <p>Ok...</p> <blockquote> <p>By the weak law of large numbers, investment $i$'s average return rate will be close to 5% if many years passes.</p> </blockquote> <p>No. Investment $i$'s annual expected return is $10\%$, with an unspecified annual volatility $\sigma &gt; 0$. Theoretically speaking, after many years the annual return rate is still $10\%$. Indeed $10\%$ is the <strong>expected</strong> annual return rate.</p> <blockquote> <p>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.</p> </blockquote> <p>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$.</p> <p>Conversely, the (virtually) risk-free asset has a $5\%$ annual return rate and zero volatility.</p> https://quant.stackexchange.com/questions/24545/-/24553#24553 6 Answer by stochazesthai for Statistics for quantitative finance stochazesthai https://quant.stackexchange.com/users/19515 2016-02-26T09:26:26Z 2016-02-26T09:26:26Z <p>I think that "An Introduction to Statistical Learning: with Applications in R (Springer Texts in Statistics)" suggested by KarolisR could be useful but too much machine learning oriented. Moreover, such a book is for beginners.</p> <p>As a thorough book (PhD level) on statistics, I suggest "Statistical Inference" by Casella and Berger.</p> https://quant.stackexchange.com/q/24524 0 buy asset after exercising call options stochazesthai https://quant.stackexchange.com/users/19515 2016-02-25T14:09:19Z 2016-02-25T17:56:03Z <p>Suppose that I buy a call option at \$10 for a stock$S_0 = \$100$, $K = \$110$, expiry date$T$.</p> <p>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$.</p> <p>However, can I just directly take the profit or do I have to buy (at $\$110$) and then sell?</p> <p>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)?</p> https://quant.stackexchange.com/questions/19464/reference-for-elementary-mortgage-math/21549?cid=34808#21549 Comment by stochazesthai on reference for elementary mortgage math stochazesthai https://quant.stackexchange.com/users/19515 2016-03-02T08:05:51Z 2016-03-02T08:05:51Z what is FRM Quant program? https://quant.stackexchange.com/questions/24606/why-is-nd-2-not-needed-for-hedging/24607?cid=34766#24607 Comment by stochazesthai on Why is$N(d_2)\$ not needed for hedging? stochazesthai https://quant.stackexchange.com/users/19515 2016-02-29T06:55:10Z 2016-02-29T06:55:10Z You are right. I added some steps of the derivation.