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

You are not logged in.

- Topics: Active | Unanswered

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

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

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

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

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

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

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

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

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

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

andAlso 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 GBMDoes this sound right in your experience?

Thank you

Linda

Offline

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

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

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

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

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

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

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

I suggest you go to quantnet forum

**X'(y-Xβ)=0**

Offline

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

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

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

Hi bobbym,

I believe I'm thick skinned enough (I'm the only girl in the course ), what would you recommend?

I have frequented Wilmott and Nuclear Phynance before and I agree sometimes there are condescending posters there.

Offline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Shortly,Yahoo answers is retarded.

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

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

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

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

Look it up.

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

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

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

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

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

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

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

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

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

I know. I was just making a statement.

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