{"categories":["Computational Methods"],"contentHtml":"<h2>Three New Topics</h2>\n<p>Cubic Splines, you solve something that is like a tridiagonal system</p>\n<p>Artificial Neural Network multilayer perceptron…</p>\n<p>Copulas (useful for 680)</p>\n<h2>American Option Valuation</h2>\n<p>page 192 of the QF book</p>\n<p>the whole point of this is that you can exercise this at any time.</p>\n<p>So when do we exercise, at time τ?</p>\n<p>$$\\tau \\in [0, T]$$</p>\n<p>There is a short, bad theorem that will help us.</p>\n<p>If the underlying process does not pay dividends, and is continuous, then the price of an American call and a European call are identical.</p>\n<p>You can prove this (the proof in the book is incorrect):</p>\n<p>Clearly, $$C_A(S, t) \\geq C_E(S, t)$$ American call for price S and time t, and European, because the American has extra on top of the call. And this is also true for the Put.</p>\n<p>$$C_A(S, t) \\geq (S_t - K)_+$$</p>\n<p>$$P_A(S, t) \\geq (K - S_t)_+$$</p>\n<p>You can argue this from a no-arbitrage argument, because if this were not true, you could instantly buy the option and exercise it and make money.</p>\n<p>In general, no-arbitrage arguments go by assuming that there is a strict inequality, then showing how you can buy low and sell high and make money instantly.</p>\n<p>Furthermore,</p>\n<p>$$C_A(S, t) \\geq S_t - Ke^{-r(T-t)}$$</p>\n<p>Why? We can do another non-arbitrage argument. You can put some money in a bank and get that K term risk-free. If we take the opposite of this, we can buy the cheap thing and sell the expensive thing. You buy the call option and the K ZCB (which becomes negative when you move it to the other side).</p>\n<p>First you short sell 1 share of stock (S_t)</p>\n<p>Then you borrow Kert and put it in a bank</p>\n<p>Then you buy 1 call</p>\n<p>Because of this inequality, I will receive S_t, and take my portion of the money I get and after taking away the call premium and the Kert, I’m left with a positive quantity.</p>\n<p>Everything with a minus is a liability, everything with a plus I have.</p>\n<p>At time T, my S becomes S_T, which I have to give back because I short sold it. Then I will receive K and it will make up the balance</p>\n<p>Note that Kert is less than K, because e is raised to a negative exponent. And therefore</p>\n<p>$$C_A(S, t) \\geq S_t - Ke^{-r(T - t)} \\geq S_t - K$$</p>\n<p>Because the value is always greater than the early payoff, then you should never exercise it early.</p>\n<p>The derivation in the book is wrong.</p>\n<p>This doesn’t work for puts.</p>\n<p>This result will also hold for continuous dividends, not discrete dividends.</p>\n<h3>Free Boundary</h3>\n<p>To understand the American option problem, we have to understand the free boundary problem. In the differential equation described, you have a system of equations you have to tie down with boundaries. There are two types of boundaries, Neumann in terms of the actual function, Dirichlet which is expressed in the derivative. This is one boundary on the top and one boundary at the bottom (and the terminal condition). These are tied down to these curves.</p>\n<p>Now a free boundary problem (which the American problem is) has another condition. This condition is not in a specific location. When are you going to exercise? When the expected future value of my option is going to be equal to or less than the value when I exercise now. If I exercise now and make more money, I should do that. But you don’t know what value of S and t will give you this. The problem is that you have to find this boundary.</p>\n<p>In the book, it refers to the physics problem. A lot of the applications of these math problems come from physics. In our case, let’s say I price an American Put. The payoff is at $$(K - S_T)_+$$</p>\n<p>You can prove that because the form of the function is monotonic. This is the final payoff, so it decreases as S increases, and then stays the same, so it is not. Then the value of the put option is also monotonic.</p>\n<p>There exists a price for the stock</p>\n<p>$$S_f(t)$$</p>\n<p>At any time t, this stock price exists, the “frontier” price (another name for boundary)</p>\n<p>we exercise if $$S_t &lt; S_f(t)$$ and we hold if $$S_t &gt; S_f(t)$$</p>\n<p>What is the point of this? It’s a put option, so you make money if the stock price goes down. If the stock price is high, you make no money, and you want to hold. However, if the price is too low, maybe it will bounce up, so I should probably exercise.</p>\n<p>If you look instantaneously, like a fraction of a second right before maturity, and you should definitely exercise if the option is in the money. So there’s a region that has no exercise and a region where you do exercise.</p>\n<p>There’s a theorem:</p>\n<p>$$\\frac{\\partial P_A}{\\partial S}(S_f, t) = -1$$</p>\n<p>The derivative right at the frontier is -1. If you’re exercising at the frontier, the value you get is K - S_f, so you have take the derivative with respect to S_f, it becomes -1. There are a couple more steps in the actual proof because you need to say that it’s continuous and so on but this is the basic idea.</p>\n<p>If $$S_t \\leq S_f$$, then we exercise and get immediately $$(K - S_t)_+$$</p>\n<p>Then the free boundary problem tells us:</p>\n<p>$$P(S_F, t) = (K - S_f)_+$$</p>\n<p>and</p>\n<p>$$\\frac{\\partial P_A}{\\partial S}(S_f, t) = -1$$</p>\n<p>As opposed to the other boundary problem, where it’s at fixed T, and you don’t know what S_f is.</p>\n<h3>Linear Complementarity Problem (LCP)</h3>\n<p>$$(\\frac{\\partial P}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 P}{\\partial S^2} + rS \\frac{\\partial P}{\\partial S} - rP) (P_A(S, t) - (K - S)_+) = 0$$</p>\n<p>For the first parentheses, this is geq 0, and the second parenthesis is also geq 0 . On each side of the space, one of them is 0. It’s the same as the tree. You went to a point, and if that point is more worth it to exercise, you would store the value that comes from the tree. In American, you’re never going to solve the early exercise.</p>\n<p>Go back to your code for the American put and make the notes where you early exercise in red, and where you don’t exercise in black. In the lower part of the tree, you always exercise, and in the higher part you never do.</p>\n<p>Left paren is you cannot exercise, and right paren is where you do. If you don’t exercise, the fair value is the european value.</p>\n<p>If this stock value happens to be falling, then you exercise and right paren takes precedence.</p>\n<p>We set up the problem so that it takes over when you exercise.</p>\n<p>And then we also have the free boundary problems mentioned earlier.</p>\n<p>Basically, we solve the LCP using finite difference.</p>\n<p>In this, there are a bunch of steps that are reducing the problem, mentioned in the book like logarithm transformation, time transformation, and then you get equation 7.4.1</p>\n<p>When you look at the finite difference method, you are looking backwards from the b_i column at the end, and then u_{i+1}</p>\n<p>(however we are going forward not backward)</p>\n<p>And then you solve it with AUi+1 = bi</p>\n<p>But that’s for European. With American we get inequalities</p>\n<p>$$AU_{i+1} \\geq b_i$$</p>\n<p>$$U_{i+1} \\geq g_{i+1}$$</p>\n<p>The book will mention this g condition, describes the no-arbitrage condition.</p>\n<p>To solve this system, we have to use what we learned last time about solutions.</p>\n<p>We can use Jacobi or Gauss-Seidel. Gauss-Seidel is more computationally efficient because you only need one vector. Sometimes Jacobi is faster because Gauss-Seidel goes further, so it might go further in the wrong direction.</p>\n<h3>Successive Over Relaxation</h3>\n<p>Recently, 70 years ago, they invented <strong>Successive Over Relaxation (SOR)</strong> which is used a lot in machine learning.</p>\n<p>We don’t have much ML in the core of financial engineering, so we should be putting some methodology.</p>\n<p>Bishop had a million ML methods and didn’t explain how.</p>\n<p>$$U^{(k)} = U^{(k - 1)} + (U^{(k)} - U^{(k - 1)}$$</p>\n<p>This illustrates an innovation from an old thing to a new thing. This particular example does nothing. Let’s do this instead. Instead of moving all the way to U^k, let’s move a little bit with ω</p>\n<p>$$U^{(k)} = U^{(k-1)} + \\omega (U^{(k)} - U^{(k-1)})$$</p>\n<p>If you make it less than 1, than you’re moving a fraction or otherwise you’re moving too much according to Gauss-Seidel.</p>\n<p>Somehow that doesn’t make sense because we don't have U^(k) yet, so how do we do this?</p>\n<p>We’ll store the whole Jacobi expression into a single variable y_j</p>\n<p>Then you calculate</p>\n<p>$$U_j^{(k)} = U_j^{(k-1)} + \\omega (y_j - u_j^{(k-1)})$$\nSo basically instead of moving all the way with y_j, you preserve it a little bit, and you decide how much you move based on ω. You can also change ω at every step, but this is not generally done. This is the SOR method. This is used to solve American options.</p>\n<p>You don’t need to know the excruciating details, but you should know the big ideas.</p>\n<h3>Cubic Splines</h3>\n<p>These were developed to approximate functions</p>\n<p>Let’s say we observe f: (a, b) -&gt; R</p>\n<p>You don’t know the value of the function, maybe it’s really complicated, you want to approximate it.</p>\n<p>in regression, you have a bunch of points, and you fit one line.</p>\n<p>Let’s say our points are all over the place, and a line does not really fit.</p>\n<p>You could group all the points as some kind of average, between the x and y coordinates, so you get multiple centers of mass for each region.</p>\n<p>Then you want the curve to go through those points. The initial point distribution is totally irrelevant.</p>\n<p>It doesn’t have to be a function. What if I have something that goes in circles, or has behavior that doesn’t go in circles. This is the computer science extension which uses B-splines, and conceptually there is no difference.</p>\n<p>This is the principle. I do an endpoint approximation. We want to approximate f with piecewise polynomials, different polynomials on each segment.</p>\n<p>We have n + 1 knots, these known points. It’s kind of like an anchor point to tie down your curve.</p>\n<p>In our process, we take</p>\n<p>$$t_i = a + \\frac{b-a}{n} i$$</p>\n<p>That fractional thing is our Δt.</p>\n<p>They don’t have to be like this. In general, we can have t_0, t_1, … t_n and it will work the same way.</p>\n<p>What is the condition? I want to make my curve smooth. I’m going to pick for each interval $$[t_i, t_{i + 1}]$$ we have $$f(t) = P_i(t)$$ polynomial</p>\n<p>What are the conditions on this polynomial?</p>\n<p>Let’s understand what happens at $$t_{i-1}, t_i, t_{i+1}$$,</p>\n<p>Well, one condition is that the polynomials have to connect, so $$P_{i-1}(t_i) = P_i(t_i) = f(t_i)$$</p>\n<p>And this becomes two equations for each i. That becomes 2n conditions.</p>\n<p>Then I have to stitch them.</p>\n<p>I don’t actually know what the derivative of the polynomial is. If I did know, I could impose the extra conditions that has another 2n conditions, for a total of 4n. But this is only if you know the derivative is, which would make this a lot easier.</p>\n<p>You need to pick a cubic spline.</p>\n<p>The realistic condition:</p>\n<p>$$\\frac{\\partial P_0}{\\partial t} (t_i) = \\frac{\\partial P_1}{\\partial t} (t_1)$$</p>\n<p>You have 2n - 2 equations</p>\n<p>So how do you interpolate?</p>\n<p>You could take a linear polynomial</p>\n<p>$$P_i(t) = a_i + b_i t$$</p>\n<p>This will clearly not work. You have 2n unknowns and 4n - 2 equations.</p>\n<p>The same is true for quadratic.</p>\n<p>Cubic gives us</p>\n<p>$$P_i(t) = a_i + b_i + c_i t^2 + d_i t^3$$</p>\n<p>Now we have 4n unknowns and 4n - 2 equations. So how do we fix this?</p>\n<p>There are n + 1 points.</p>\n<p>There’s a very clear order unless you somehow define it. And that determines how you stitch the functions. There’s an infinite number of solutions by fixing the two missing equations.</p>\n<p>In traditinoal splines that come from statistics, the way it works is that there’s two possibilities.</p>\n<p>There can be a free boundary problem where the $$S_0’’ t(0) = S_nn’’ t(n) = 0$$</p>\n<p>When you say the second derivative is 0, that’s the maximum of the first derivative.\nIt starts with the largest slope possible,</p>\n<p>Then the second one is the clamped boundary</p>\n<p>$$S_0’ (t_0) = f(t_0)$$</p>\n<p>$$S_n’ (t_n) = f’(t_n)$$</p>\n<p>Because you don’t know the derivative, you constrain the curve to have a certain fixed slope.</p>\n<p>You constrain the first one to start at a certain angle.</p>\n<p>Then how do you solve this? It’s in terms of the functions and their derivatives.</p>\n<p>I plug in these points and gets an equations in a_i, b_i, c_i, and d_i, and then the next parameters.</p>\n<p>Basically I have four end parameters, and since these equations are relative to each other, it becomes a sparse system of equations.</p>\n<p>It’s not tridiagonal, but it does have a system.</p>\n<p>Then you solve it with Jacobi, Gauss-Seidel, SOR, etc. when you solve it in R.</p>\n<p>These are very useful for smoothing approximations of curve. I have used them in my lecture earlier in the pricing the implied vol surface paper. This whole paper is inspired by two dimensional cubic splines. Basically, the Derman people created a bullshit local volatility problem. I thought about it and I realized, if you give me the option prices, and get the IV, and then fit a curve through these things. R had just created the 2D approximation and just used this. It’s basically the same as just described, but you do it with a line instead of points, but I don’t remember how and it’s pretty complicated.</p>\n<p>There are many many applications to all of these numerical methods.</p>\n<p>I learned about this realized volatility surface from these people, reading about this other method of approximation, and putting them together. That’s why it’s very important to learn approximation methods.</p>\n<p>There’s many people that start the task, cut government waste, and then you go in there and have no clue what you’re doing. Method, knowing what to do is the most important thing.</p>\n<p>Either you get videos from FOX that are BINGQILIN</p>","contentMarkdown":"## Three New Topics\n\nCubic Splines, you solve something that is like a tridiagonal system\n\nArtificial Neural Network multilayer perceptron…\n\nCopulas (useful for 680\\)\n\n## American Option Valuation\n\npage 192 of the QF book\n\nthe whole point of this is that you can exercise this at any time.\n\nSo when do we exercise, at time τ?\n\n$$\\\\tau \\\\in \\[0, T\\]$$\n\nThere is a short, bad theorem that will help us.\n\nIf the underlying process does not pay dividends, and is continuous, then the price of an American call and a European call are identical.\n\nYou can prove this (the proof in the book is incorrect):\n\nClearly, $$C\\_A(S, t) \\\\geq C\\_E(S, t)$$ American call for price S and time t, and European, because the American has extra on top of the call. And this is also true for the Put.\n\n$$C\\_A(S, t) \\\\geq (S\\_t \\- K)\\_+$$\n\n$$P\\_A(S, t) \\\\geq (K \\- S\\_t)\\_+$$\n\nYou can argue this from a no-arbitrage argument, because if this were not true, you could instantly buy the option and exercise it and make money.\n\nIn general, no-arbitrage arguments go by assuming that there is a strict inequality, then showing how you can buy low and sell high and make money instantly.\n\nFurthermore,\n\n$$C\\_A(S, t) \\\\geq S\\_t \\- Ke^{-r(T-t)}$$\n\nWhy? We can do another non-arbitrage argument. You can put some money in a bank and get that K term risk-free. If we take the opposite of this, we can buy the cheap thing and sell the expensive thing. You buy the call option and the K ZCB (which becomes negative when you move it to the other side).\n\nFirst you short sell 1 share of stock (S\\_t)\n\nThen you borrow Kert and put it in a bank\n\nThen you buy 1 call\n\nBecause of this inequality, I will receive S\\_t, and take my portion of the money I get and after taking away the call premium and the Kert, I’m left with a positive quantity.\n\nEverything with a minus is a liability, everything with a plus I have.\n\nAt time T, my S becomes S\\_T, which I have to give back because I short sold it. Then I will receive K and it will make up the balance\n\nNote that Kert is less than K, because e is raised to a negative exponent. And therefore\n\n$$C\\_A(S, t) \\\\geq S\\_t \\- Ke^{-r(T \\- t)} \\\\geq S\\_t \\- K$$\n\nBecause the value is always greater than the early payoff, then you should never exercise it early.\n\nThe derivation in the book is wrong.\n\nThis doesn’t work for puts.\n\nThis result will also hold for continuous dividends, not discrete dividends.\n\n### Free Boundary\n\nTo understand the American option problem, we have to understand the free boundary problem. In the differential equation described, you have a system of equations you have to tie down with boundaries. There are two types of boundaries, Neumann in terms of the actual function, Dirichlet which is expressed in the derivative. This is one boundary on the top and one boundary at the bottom (and the terminal condition). These are tied down to these curves.\n\nNow a free boundary problem (which the American problem is) has another condition. This condition is not in a specific location. When are you going to exercise? When the expected future value of my option is going to be equal to or less than the value when I exercise now. If I exercise now and make more money, I should do that. But you don’t know what value of S and t will give you this. The problem is that you have to find this boundary.\n\nIn the book, it refers to the physics problem. A lot of the applications of these math problems come from physics. In our case, let’s say I price an American Put. The payoff is at $$(K \\- S\\_T)\\_+$$\n\nYou can prove that because the form of the function is monotonic. This is the final payoff, so it decreases as S increases, and then stays the same, so it is not. Then the value of the put option is also monotonic.\n\nThere exists a price for the stock\n\n$$S\\_f(t)$$\n\nAt any time t, this stock price exists, the “frontier” price (another name for boundary)\n\nwe exercise if $$S\\_t \\< S\\_f(t)$$ and we hold if $$S\\_t \\> S\\_f(t)$$\n\nWhat is the point of this? It’s a put option, so you make money if the stock price goes down. If the stock price is high, you make no money, and you want to hold. However, if the price is too low, maybe it will bounce up, so I should probably exercise.\n\nIf you look instantaneously, like a fraction of a second right before maturity, and you should definitely exercise if the option is in the money. So there’s a region that has no exercise and a region where you do exercise.\n\nThere’s a theorem:\n\n$$\\\\frac{\\\\partial P\\_A}{\\\\partial S}(S\\_f, t) \\= \\-1$$\n\nThe derivative right at the frontier is \\-1. If you’re exercising at the frontier, the value you get is K \\- S\\_f, so you have take the derivative with respect to S\\_f, it becomes \\-1. There are a couple more steps in the actual proof because you need to say that it’s continuous and so on but this is the basic idea.\n\nIf $$S\\_t \\\\leq S\\_f$$, then we exercise and get immediately $$(K \\- S\\_t)\\_+$$\n\nThen the free boundary problem tells us:\n\n$$P(S\\_F, t) \\= (K \\- S\\_f)\\_+$$\n\nand\n\n$$\\\\frac{\\\\partial P\\_A}{\\\\partial S}(S\\_f, t) \\= \\-1$$\n\nAs opposed to the other boundary problem, where it’s at fixed T, and you don’t know what S\\_f is.\n\n### Linear Complementarity Problem (LCP)\n\n$$(\\\\frac{\\\\partial P}{\\\\partial t} \\+ \\\\frac{1}{2} \\\\sigma^2 S^2 \\\\frac{\\\\partial^2 P}{\\\\partial S^2} \\+ rS \\\\frac{\\\\partial P}{\\\\partial S} \\- rP) (P\\_A(S, t) \\- (K \\- S)\\_+) \\= 0$$\n\nFor the first parentheses, this is geq 0, and the second parenthesis is also geq 0 . On each side of the space, one of them is 0\\. It’s the same as the tree. You went to a point, and if that point is more worth it to exercise, you would store the value that comes from the tree. In American, you’re never going to solve the early exercise.\n\nGo back to your code for the American put and make the notes where you early exercise in red, and where you don’t exercise in black. In the lower part of the tree, you always exercise, and in the higher part you never do.\n\nLeft paren is you cannot exercise, and right paren is where you do. If you don’t exercise, the fair value is the european value.\n\nIf this stock value happens to be falling, then you exercise and right paren takes precedence.\n\nWe set up the problem so that it takes over when you exercise.\n\nAnd then we also have the free boundary problems mentioned earlier.\n\nBasically, we solve the LCP using finite difference.\n\nIn this, there are a bunch of steps that are reducing the problem, mentioned in the book like logarithm transformation, time transformation, and then you get equation 7.4.1\n\nWhen you look at the finite difference method, you are looking backwards from the b\\_i column at the end, and then u\\_{i+1}\n\n(however we are going forward not backward)\n\nAnd then you solve it with AUi+1 \\= bi\n\nBut that’s for European. With American we get inequalities\n\n$$AU\\_{i+1} \\\\geq b\\_i$$\n\n$$U\\_{i+1} \\\\geq g\\_{i+1}$$\n\nThe book will mention this g condition, describes the no-arbitrage condition.\n\nTo solve this system, we have to use what we learned last time about solutions.\n\nWe can use Jacobi or Gauss-Seidel. Gauss-Seidel is more computationally efficient because you only need one vector. Sometimes Jacobi is faster because Gauss-Seidel goes further, so it might go further in the wrong direction.\n\n### Successive Over Relaxation\n\nRecently, 70 years ago, they invented **Successive Over Relaxation (SOR)** which is used a lot in machine learning.\n\nWe don’t have much ML in the core of financial engineering, so we should be putting some methodology.\n\nBishop had a million ML methods and didn’t explain how.\n\n$$U^{(k)} \\= U^{(k \\- 1)} \\+ (U^{(k)} \\- U^{(k \\- 1)}$$\n\nThis illustrates an innovation from an old thing to a new thing. This particular example does nothing. Let’s do this instead. Instead of moving all the way to U^k, let’s move a little bit with ω\n\n$$U^{(k)} \\= U^{(k-1)} \\+ \\\\omega (U^{(k)} \\- U^{(k-1)})$$\n\nIf you make it less than 1, than you’re moving a fraction or otherwise you’re moving too much according to Gauss-Seidel.\n\nSomehow that doesn’t make sense because we don't have U^(k) yet, so how do we do this?\n\nWe’ll store the whole Jacobi expression into a single variable y\\_j\n\nThen you calculate\n\n$$U\\_j^{(k)} \\= U\\_j^{(k-1)} \\+ \\\\omega (y\\_j \\- u\\_j^{(k-1)})$$\nSo basically instead of moving all the way with y\\_j, you preserve it a little bit, and you decide how much you move based on ω. You can also change ω at every step, but this is not generally done. This is the SOR method. This is used to solve American options.\n\nYou don’t need to know the excruciating details, but you should know the big ideas.\n\n### Cubic Splines\n\nThese were developed to approximate functions\n\nLet’s say we observe f: (a, b) \\-\\> R\n\nYou don’t know the value of the function, maybe it’s really complicated, you want to approximate it.\n\nin regression, you have a bunch of points, and you fit one line.\n\nLet’s say our points are all over the place, and a line does not really fit.\n\nYou could group all the points as some kind of average, between the x and y coordinates, so you get multiple centers of mass for each region.\n\nThen you want the curve to go through those points. The initial point distribution is totally irrelevant.\n\nIt doesn’t have to be a function. What if I have something that goes in circles, or has behavior that doesn’t go in circles. This is the computer science extension which uses B-splines, and conceptually there is no difference.\n\nThis is the principle. I do an endpoint approximation. We want to approximate f with piecewise polynomials, different polynomials on each segment.\n\nWe have n \\+ 1 knots, these known points. It’s kind of like an anchor point to tie down your curve.\n\nIn our process, we take\n\n$$t\\_i \\= a \\+ \\\\frac{b-a}{n} i$$\n\nThat fractional thing is our Δt.\n\nThey don’t have to be like this. In general, we can have t\\_0, t\\_1, … t\\_n and it will work the same way.\n\nWhat is the condition? I want to make my curve smooth. I’m going to pick for each interval $$\\[t\\_i, t\\_{i \\+ 1}\\]$$ we have $$f(t) \\= P\\_i(t)$$ polynomial\n\nWhat are the conditions on this polynomial?\n\nLet’s understand what happens at $$t\\_{i-1}, t\\_i, t\\_{i+1}$$,\n\nWell, one condition is that the polynomials have to connect, so $$P\\_{i-1}(t\\_i) \\= P\\_i(t\\_i) \\= f(t\\_i)$$\n\nAnd this becomes two equations for each i. That becomes 2n conditions.\n\nThen I have to stitch them.\n\nI don’t actually know what the derivative of the polynomial is. If I did know, I could impose the extra conditions that has another 2n conditions, for a total of 4n. But this is only if you know the derivative is, which would make this a lot easier.\n\nYou need to pick a cubic spline.\n\nThe realistic condition:\n\n$$\\\\frac{\\\\partial P\\_0}{\\\\partial t} (t\\_i) \\= \\\\frac{\\\\partial P\\_1}{\\\\partial t} (t\\_1)$$\n\nYou have 2n \\- 2 equations\n\nSo how do you interpolate?\n\nYou could take a linear polynomial\n\n$$P\\_i(t) \\= a\\_i \\+ b\\_i t$$\n\nThis will clearly not work. You have 2n unknowns and 4n \\- 2 equations.\n\nThe same is true for quadratic.\n\nCubic gives us\n\n$$P\\_i(t) \\= a\\_i \\+ b\\_i \\+ c\\_i t^2 \\+ d\\_i t^3$$\n\nNow we have 4n unknowns and 4n \\- 2 equations. So how do we fix this?\n\nThere are n \\+ 1 points.\n\nThere’s a very clear order unless you somehow define it. And that determines how you stitch the functions. There’s an infinite number of solutions by fixing the two missing equations.\n\nIn traditinoal splines that come from statistics, the way it works is that there’s two possibilities.\n\nThere can be a free boundary problem where the $$S\\_0’’ t(0) \\= S\\_nn’’ t(n) \\= 0$$\n\nWhen you say the second derivative is 0, that’s the maximum of the first derivative.\nIt starts with the largest slope possible,\n\nThen the second one is the clamped boundary\n\n$$S\\_0’ (t\\_0) \\= f(t\\_0)$$\n\n$$S\\_n’ (t\\_n) \\= f’(t\\_n)$$\n\nBecause you don’t know the derivative, you constrain the curve to have a certain fixed slope.\n\nYou constrain the first one to start at a certain angle.\n\nThen how do you solve this? It’s in terms of the functions and their derivatives.\n\nI plug in these points and gets an equations in a\\_i, b\\_i, c\\_i, and d\\_i, and then the next parameters.\n\nBasically I have four end parameters, and since these equations are relative to each other, it becomes a sparse system of equations.\n\nIt’s not tridiagonal, but it does have a system.\n\nThen you solve it with Jacobi, Gauss-Seidel, SOR, etc. when you solve it in R.\n\nThese are very useful for smoothing approximations of curve. I have used them in my lecture earlier in the pricing the implied vol surface paper. This whole paper is inspired by two dimensional cubic splines. Basically, the Derman people created a bullshit local volatility problem. I thought about it and I realized, if you give me the option prices, and get the IV, and then fit a curve through these things. R had just created the 2D approximation and just used this. It’s basically the same as just described, but you do it with a line instead of points, but I don’t remember how and it’s pretty complicated.\n\nThere are many many applications to all of these numerical methods.\n\nI learned about this realized volatility surface from these people, reading about this other method of approximation, and putting them together. That’s why it’s very important to learn approximation methods.\n\nThere’s many people that start the task, cut government waste, and then you go in there and have no clue what you’re doing. Method, knowing what to do is the most important thing.\n\nEither you get videos from FOX that are BINGQILIN","dataUrl":"https://sharifhsn.dev/api/posts/computational-methods-week-07.json","date":"2025-03-11","datePublished":"2025-03-11","description":"Cubic Splines, you solve something that is like a tridiagonal system","site":"https://sharifhsn.dev","slug":"computational-methods-week-07","source":"Computational Methods in Quantitative Finance","sourceUrl":null,"tags":["Computational Methods","American Options","Linear Complementarity","Successive Over-Relaxation","Cubic Splines"],"title":"American Options and Cubic Splines","url":"https://sharifhsn.dev/blog/computational-methods-week-07/","version":"1","wordCount":2375}