My Math Forum  

Go Back   My Math Forum > Math Forums > Math Software

Math Software Math Software - Mathematica, Matlab, Calculators, Graphing Software


Reply
 
LinkBack Thread Tools Display Modes
April 10th, 2017, 10:24 AM   #1
Member
 
Joined: Sep 2013

Posts: 83
Thanks: 0

Help me understand simplification

I am trying to figure out a python code, the problem is not the code but mathematics. First, we have equation (22): $${\textstyle{{{S_c}} \over X}} = {e^{ - (r + (1/2){\sigma ^2})\tau - g\sigma \sqrt \tau }}$$
where (23): $$g = \pm \sqrt {2\log {{{\sigma ^2}} \over {{{2r} \over {\sqrt a }}x\log x{e^{ - a{{(r + (1/2){\sigma ^2})}^2}\tau /(2{\sigma ^2})}}}}} $$
where $$a = 1 - {A \over {1 + {{{{(1 + \gamma )}^2}} \over 4}{\gamma ^2}\tau }}, A = {1 \over 2}{\left( {{\gamma \over {1 + \gamma }}} \right)^2}$$ and $$x = {X \over {{S_c}}},\gamma = {{2r} \over {{\sigma ^2}}}$$





NOW, to the question, Here is the Python code:



Code:
  
alpha = 1.0 - ( .5 * gamma * gamma / (1.0 + gamma)**2 ) / ( 1.0 + (1.0 + gamma)**2 * vol * vol * (tau - t) / 4.0 )
val1 = (r+.5*vol*vol)*(tau-t)
val2 = exp(-alpha*(tau-t)*(r+.5*vol*vol)**2/(2*vol*vol))
val3 = vol*vol*sqrt(alpha)/r/2.0
func = lambda g: exp(g*g/2) - val3 / (val1+g*vol*sqrt(tau-t)) / exp(val1+g*vol*sqrt(tau-t)) / val2

I CANT see how (note: , vol is $\sigma$, a is $\alpha$, K is $X$, (tau-t) is $\tau$.)


Code:
g: exp(g*g/2) - val3 / (val1+g*vol*sqrt(tau-t)) / exp(val1+g*vol*sqrt(tau-t)) / val2
Represents equation (23)? Its obvious that he has tried to simplify the original equation, i asked the author and he gave me two hints that i should use :Log(x/y) = log x - log y and
log(e^x) = x.


If you write out the code :


Ku5htr1m is offline  
 
Reply

  My Math Forum > Math Forums > Math Software

Tags
simplification, understand



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me understand simplification Ku5htr1m Calculus 0 April 10th, 2017 10:19 AM
Need help with simplification Caesar95 Algebra 1 May 10th, 2015 04:01 AM
Simplification 3uler Trigonometry 1 February 3rd, 2015 04:08 AM
Help me understand this step in an algebraic simplification? SamSeymour Algebra 3 February 4th, 2014 01:49 PM
Need some help with simplification p3aul Algebra 5 January 23rd, 2011 10:11 PM





Copyright © 2017 My Math Forum. All rights reserved.