File:Euler-Maruyama-Verfahren zur Berechnung eines Ornstein-Uhlenbeck-Prozesses.svg

Summary

Description
Deutsch: Euler-Maruyama-Verfahren zur Berechnung eines Ornstein-Uhlenbeck-Prozesses
Date
Source Own work
Author Daniel Mietchen

Python code

import numpy as np
import matplotlib.pyplot as plt

tBegin=0
tEnd=2
dt=.00001

t = np.arange(tBegin, tEnd, dt)
N = t.size
IC=0
theta=1
mu=1.2
sigma=0.3

sqrtdt = np.sqrt(dt)
y = np.zeros(N)
y[0] = IC
for i in range(1,N):
    y[i] = y[i-1] + dt*(theta*(mu-y[i-1])) + sigma*np.random.normal(loc=0.0,scale=sqrtdt)

fig, ax = plt.subplots()
ax.plot(t,y)
ax.set(xlabel='t', ylabel='y',
       title='Euler-Maruyama-Verfahren zur Berechnung eines \n Ornstein-Uhlenbeck-Prozesses mit $\\theta=1$, $\mu=1.2$, $\sigma=0.3$')
ax.grid()

fig.savefig("Euler-Maruyama-Verfahren zur Berechnung eines Ornstein-Uhlenbeck-Prozesses.svg")
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Euler-Maruyama-Verfahren%20zur%20Berechnung%20eines%20Ornstein-Uhlenbeck-Prozesses.svg
Category:Self-published work Category:Created with Matplotlib code Category:Ornstein-Uhlenbeck process
Category:CC-Zero Category:Created with Matplotlib code Category:Ornstein-Uhlenbeck process Category:Self-published work