[eqn] dS_t = mu S_t dt + sigma S_t dW_t [/eqn]

> [eqn] dS_t = \mu S_t dt + \sigma S_t dW_t [/eqn]

Do people in the real world actually model stocks and options with this?

Other urls found in this thread:

en.wikipedia.org/wiki/Black–Scholes_equation
en.wikipedia.org/wiki/Euler–Maruyama_method
en.m.wikipedia.org/wiki/Feynman–Kac_formula
en.m.wikipedia.org/wiki/Path_integral_formulation
twitter.com/SFWRedditGifs

Yep en.wikipedia.org/wiki/Black–Scholes_equation

lul some dudes decided to see if the heat equation modeled stocks and they got a nobel prize for it

Have you ever seen the one-page proof of the existence of Nash Equilibria by the Kakutani fixed point theorem? It's as easy to get the economics prize if you're a mathematician as it is to get the peace prize if you're a politician.

That's fucking bullshit, how would anyone get extra information by modelling a stock price like this? Real world events don't follow a brownian motion.

Evidence says you're wrong.

Real world events can't be characterized like that. But sums of very many little real world events can.
It's funny how when there is a major crash Black Scholes is useless but the rest of the time people can use it to determine how to hedge away their risk.

So where do people derive the volatility from for the SDE? Historical prices? Estimations?

Just finished reading In Pursuit of the Unknown by Stewart, the last chapter focused on the Black-Scholes equation and makes the claim that misuse of it is one of the big factors in recent financial crises. It assumes that probability of future derivative price follows a normal distribution, when the real distribution appears to have fat tails.

Can't tell you how good of a resource this is, but I thought I'd contribute this since I just saw it.

This is something that bugs the shit out of me:

On wikipedia for numerical solutions to the SDE in the OP, they say that [math] \Delta W_tau = W_{t} - W_{t-1} [/math] is a random variable with mean 0 and variance [math] \Delta t [/math]. Now I get that, but what all these numerical solutions do, is they draw a number from N(0,1) and then multiply that number with [math] \sqrt{ \Delta t } [/math] instead of just drawing a number from N(0, dt) right away. Is there something I'm missing here? Are these things equivalent and am I just so stupid to miss it?

people on the finance world know that as well, it's literally in every text book on stocks

Ah, shite I evaluated it with the CLT and it actually is equivalent!

Yes it's equivalent.
Usually the implemented function in randn, which follows the law N(0,1).
It's probably more efficient to use randn and multiply the result than draw from N(0,dt) (a function which might not even exist anyway).

I see, interesting. Even though I swear Matlab had such a function.

OP here, I just did a simulation for DB's share price for the next 2000 days. I used the SDE in the OP and this:

en.wikipedia.org/wiki/Euler–Maruyama_method

Anyone else did cool things with SDEs?

What's happening with that green one?

Look up implied volatility

Probably too coarse of a timestep.

Anyone have a good intro textbook for this?

I did 8 trial paths. In the green one the brownian motion probably got positive all the time.

I'm also very interested in this.

Bump, I did another simulation, this time on Goldman's stock.

This is tremendous fun.

did he win for proving Nash Equilibria always existed, or for formalising Nash Equilibria in the first place?

To be honest family, I wrote that code on the Wikipedia page and I'm not 100% sure about the implementation of dW(). If abyone can check the use of dt's in that line, that be cool
>trusting Wikipedia

In any case, there is a python implementation package for SDE solvers on github ("sde-master" or something, easy to google) that should be more trustworthy

Regarding the OP, from reading SE quant and some introductory texts, the traders use codes as blackbox and this is all not so jigh end from the math side. I have friends that worked for banks etc, and usually you'll be forced to get into old code (BASIC, even) and modulate them. Because they sure will npt drop their working tools.

That's very interesting code desu and I think it's correct.

This is my Matlab implementation:

for j = 1 : trials
dW = sqrt(dt)*randn([1 N]);
X(1) = X0;
for i = 1 : N-1;
X(i+1) = X(i)+a*X(i)*dt+b*X(i)*dW(i);
end;
plot(t,X);
hold on;
end;

What do you think? What books did you read? Please stay in the thread, this is an area of math that greatly interests me but I won't have the opportunity to take classes in it until I'm in my master's.

>en.wikipedia.org/wiki/Euler–Maruyama_method
Also, if you're still here, I don't understand why you multiplied it by "sqrt(dt)" again, after you already took a random normal variable from N(0,dt).

> dW = lambda: np.random.normal(loc = 0.0, scale = np.sqrt(dt)) * np.sqrt(dt)

I want to learn economics (both macro and micro). I have a good math background. Any book recommendations?

Exactly what I was criticizing myself. Itdidn't matter inasfar as dt is fixed and the factor c_sigma was a parameter (rescaling), but I fixed it (I suppose) now.

I initially entered the subject with an interest in the stochastic formulation of Quantum Mechanics where the difference in different discretizations are embodied in non-commutative commutation relations. I can make a rant on that, unless you don't know any QM

Yeah, looks like you fixed it just now.

Also I don't understand shit from the last part you said. Do you have any books I can read on SDEs?

I have no reference I really like and so no honest recommendation. Some people on the webs talked about Levy processes and then I found books on path integeals that give some flavours of the theory. Some of the math of stochastic calculus appears unecessay to me.
Then I read parts of Springers "Stochastic Differebtial Equations" by Oksendal, which was bearable. Seems like pic related is an okay summary-like reference book, maybe start there

Thank you, I'll look into it.

evidence says hes correct, its well knows stocks dont follow Brownian motion.

Microeconomic Theroy, Basic Principles and Extensions by Nicholson, Snyder and Advanced Macroeconomics by Romer

Do these approach economics from a math perspective?

Say you have a desk of 1m and in the time of 1s, you move your finger with position x(t) along the edge of it, from x(t=0) to x(t=1), in the following way:
[math] x(t) := \sqrt{t} [/math]
It’s a simple idea, but not technically feasible in Newtonian mechanics, because it the first moment t=0, you must accelerate your finger with infinite force:

For p>0, we have

[math] \int_\epsilon^1 (p\,t^{p-1})\, d t=\int_\epsilon^1dt^p = 1-\epsilon^p [/math]

and

[math]\lim_{\epsilon\to 0} \int_\epsilon^1 (p\,t^{p-1})\, d t = 1 [/math]

doesn't even depend on the value of p.

What's not so nice here is that the naive integral [math]\int_0^1(p\,t^{p-1})\,dt [/math] doesn't exist for [math]p\in(0,1) [/math]. This is because [math]\lim_{t\to 0} [/math] of e.g. [math]t^{\tfrac{1}{2}-1}=\tfrac{1}{\sqrt{t}} [/math] doesn't exist.
We can also formulate that issue by saying that for [math]p\in(0,1) [/math], the function [math]t^p [/math] in [math]\int_\epsilon^1dt^p [/math] isn't differentiable at t=0.

In conclusion,
"[math]\int_0^td\sqrt{s}=\sqrt{t} [/math]"
doesn't make sense, only the limit of the integral with [math]\epsilon[/math].

In physics, the accumulation of the values of a function F along a smooth path x(t) is
[math]\int_{t_0}^{t_1} F(x(s))\, dx(s) [/math],
which is
[math] \int_{t_0}^{t_1} F(x(s))\, x'(s)\, ds [/math], where

[math] x'(t) = \lim_{\Delta t\to 0} \frac{ x(t+ \Delta t)-x(t)}{ \Delta t} [/math].

E.g. for F being force, the integral along a path is the work.

The Itō integral is a limit of sums not over functions but stochastic processes, and there [math]d{ W}_t [/math] doesn't rely on differential calculus. For a Wiener process, the standard deviation of the integral gives such a stare root result.
As the density associated with a random variable obtained by a stochastic integral follows a diffusion equation, those situations arise everywhere in the microscopic world, and many models in quantum mechanics look just like that as well.

if you want more advanced books look for microeconomic theory by mas collel et al and Recursive Methods in Economic Dynamics by Stokey, Lucas and Prescott. Those are graduate level.

>E.g. for F being force, the integral along a path is the work.
Just like the line integral [math] \int_C \mathbf{F} \dot \mathrm{d} s [/math] right?

Very interesting post, thank you.

That's exactly the same thing because an integeal doesn't depend on the parametrization (assuming we keep track of the \int bounds in the first step):

ds = ds(t) = s'(t) dt

The point is that random walks where particles (e.g. in a gas) are pushed by others, randomly being kicked around, effectively jump finite distances in arbitrary small time (depending on how strong the impulse transfer is in being tackled from left and right)
and then have mean time evolution with
|x(t)| = t^(1/2)
The probabilty distribution perspective (the math formulation of stochastic processes that unlike e.g. the stochastic Euler method implemented on the Wikipedia page doesn't require "sampling" of the practitioner) lets you get a that too.
Quantum mechanics can be seen as a field theory with models that are like the dynamics of such distributions Conversely, there is a stochastic integral formulation of such models, bordering the Feynman perspective on this physics theory.
So you find his name in e.g.
en.m.wikipedia.org/wiki/Feynman–Kac_formula

The math of the fluctuation for other dW than Brownian motion can be seen as why Quantum field theory is hard or quantum gravity seems impossible. See also
en.m.wikipedia.org/wiki/Path_integral_formulation

What are you studying man? You working on your masters or PhD in Physics?

Just handed in my PhD thesis in physics.

For whoever is interested, pic related and the next are now some notes on what I talked about above, i.e. on QM relations from a stochastic Euler method perspective

...

Neat, how did you end up working on that?

>The math of the fluctuation for other dW than Brownian motion can be seen as why Quantum field theory is hard or quantum gravity seems impossible.
On top of the fact that those things are field theories, not particles. This infinite dimensionality is the real cause of problems, and quantum gravity is sort of more infinite dimensional i.e diffeomorphisms vs. gauge transformations. That's why string theory works; conformal symmetry is infinite in 2D, so you can reduce the complicated path integral over metrics to a finite number of integrals.

That's unrelated to my PhD work, which was in plasma chemistry

It's worse for field theories as you say.
Maybe worth noting that you also deal with infinite dimensionality in the case of trajectories x(t) and all possible deviations x(t)+u(t), when you try to parametrize u.

If you bring string theories abd sigma models into the picture, theb the field particle distinction becomes less meaningless, still.
Trajectories
[math] x : {\mathbb R} \to {\mathcal M} [/math]
make for a nice field theory