Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2012-04-10 14:24:59

lindah
Member
Registered: 2010-01-25
Posts: 121

Simulating Brownian Processes

Hi guys,

I've been asked to simulate a Wiener and Geometric Brownian motion computationally by generating the partial sum for the stochastic integral.

Is anyone familiar with this type of math and willing to check my code (Matlab)?
One further question is after simulating the processes I am asked to compared what I have generated to the theoretical distributions - would this mean the normal and log-normal distributions for Wiener and GMB respectively?

Thank you in advance for  any feedback
Linda

Offline

#2 2012-04-10 18:18:27

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi lindah;

I afraid I do not use Matlab at all but I am proficient in Mathematica and Maple. Is there something else I can help in?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2012-04-12 10:33:32

lindah
Member
Registered: 2010-01-25
Posts: 121

Re: Simulating Brownian Processes

Hi bobbym

Thanks for your offer to help as always!!
I found an example of simulating the process by reducing the SDE to sort of a method of finite differences.

Offline

#4 2012-04-12 10:38:21

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi lindah;

Want to post a short synapses of what you did?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2012-04-12 11:15:01

lindah
Member
Registered: 2010-01-25
Posts: 121

Re: Simulating Brownian Processes

Hi bobbym;

So i was asked to write up a program for the SDE for Geometric Brownian motion:


where
is a Wiener process

For GBM this means

and

Also I found
could be calculated as
where
is N~(0,1)

The code I wrote up for

was:

I looped this in the program to obtain


Then simply stated that

So e.g. starting value is x(0) = 1, then add the first difference
to obtain x(1). Then x(1) is added to the 2nd difference
to obtain x(2) etc

In the end plotting

gives a simulated sample path of GBM

Does this sound right in your experience?

Thank you
Linda

Offline

#6 2012-04-12 11:24:53

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi lindah;

Did it work? That is the best test.

What is this?

N~(0,1)


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2012-04-12 11:31:54

lindah
Member
Registered: 2010-01-25
Posts: 121

Re: Simulating Brownian Processes

Hi bobbym;

My simulated graph looks like all the generic GBM plots found on the topic and the data is lognormally distributed which is a good sign.

My apologies N~(0,1) is a normal distribution with mean = 0 and variance = 1

Offline

#8 2012-04-12 11:59:49

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi lindah;

It looks okay to me. Let me know whether it is correct or not.

No apology necessary, I should have remembered that. Sometimes I see it as N(0,1) too.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#9 2012-04-16 20:01:20

George,Y
Member
Registered: 2006-03-12
Posts: 1,306

Re: Simulating Brownian Processes

I suggest you go to quantnet forum


X'(y-Xβ)=0

Offline

#10 2012-04-16 20:27:39

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi All;

Normally comments like that sort of inflame my joints.

Other forums:

Since I am either a member or lurk on many of them and find them to be little but haughty bookworms, I usually get irritated when someone suggests them.

But since lindah's present course is not one that I am very familiar with I am forced to say maybe that would help. Also Linda, I could recommend a couple of others as long as you are thick skinned and do not mind being called stupid once in a while.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#11 2012-04-26 18:04:31

lindah
Member
Registered: 2010-01-25
Posts: 121

Re: Simulating Brownian Processes

Hi bobbym,

I believe I'm thick skinned enough (I'm the only girl in the course tongue), what would you recommend?
I have frequented Wilmott and Nuclear Phynance before and I agree sometimes there are condescending posters there.

Offline

#12 2012-04-26 19:01:36

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Hi lindah;

Try these three. MathOverflow, StackExchange and StackOverflow. They might help at times. There are more but you would just run into my clone.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#13 2012-04-26 19:07:59

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

Hi bobbym

Those look like they have the format of Yahoo Answers.They are more reliable of course.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#14 2012-04-26 21:08:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Yahoo answers?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#15 2012-04-26 21:10:06

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

Look it up. It is a stupid way to get relatively retarded answers fairly quickly.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#16 2012-04-26 21:11:19

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

I do not agree. Have you read this thread.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#17 2012-04-26 21:14:20

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

No,Yahoo answers is what I have said in the last post.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#18 2012-04-26 21:16:14

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

I am not following you.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#19 2012-04-26 21:22:01

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

Shortly,Yahoo answers is retarded.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#20 2012-04-26 21:23:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

Where are the yahoo answers?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#21 2012-04-26 21:25:18

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

Look it up.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#22 2012-04-26 21:26:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

I am not following you. This thread has nothing to do with yahoo.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#23 2012-04-26 21:30:38

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

I was just referring to the way those three answering forums are constructed.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#24 2012-04-26 21:32:26

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Simulating Brownian Processes

That is your opinion of course. You could mention that to them. I  had nothing to do with their structure or form. Linda asked for them, I gave her what she asked for.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#25 2012-04-26 21:33:46

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,037

Re: Simulating Brownian Processes

I know. I was just making a statement.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

Board footer

Powered by FluxBB