compartir – copiar, distribuir i comunicar públicament l'obra
adaptar – fer-ne obres derivades
Amb les condicions següents:
reconeixement – Heu de donar la informació adequada sobre l'autor, proporcionar un enllaç a la llicència i indicar si s'han realitzat canvis. Podeu fer-ho amb qualsevol mitjà raonable, però de cap manera no suggereixi que l'autor us dóna suport o aprova l'ús que en feu.
compartir igual – Si modifiqueu, transformeu, o generareu amb el material, haureu de distribuir les vostres contribucions sota una llicència similar o una de compatible com l'original
######################################################
### OU-levy processes ################################
# trajectory of an OU-process, driven by some levy process (bdlp; here cauchy or gamma)
## starting at time t=0 at Z_0=Z0 until time t=T in "steps" equidistant steps; mean reversion "mr"
## parameters of the distribution of the bdlp are stored in param
process.ou<-function(param=c(0,1),mr=1,T=1,steps=500,bdlp="cauchy",Z0=0) {
dt=T/(steps-1)
ou=array(Z0,dim=steps)
if (bdlp=="cauchy") {
dLt=rcauchy(steps-1, location=param[1], scale=param[2]*dt)
} else if (bdlp=="gamma") {
dLt=rgamma(n=steps-1, shape=param[1], scale=param[2]*dt)
}
for (tm in 1:(steps-1)) {
ou[tm+1]=ou[tm]-mr*ou[tm]*dt+dLt[tm]
}
return (list(time=seq(0,T,length=steps),Lt=c(0,cumsum(dLt)),ou=ou))
}
set.seed(29011980)
time=seq(0,5.7,length=5000)
png("Cauchy-OU.png",width=1200, height=900)
par(mfrow=c(2,1))
cou=process.ou(param=c(0,1),mr=1.2,T=max(time),steps=length(time),bdlp="cauchy",Z0=-1.9)
plot(cou$time,cou$Lt,type="p",pch=".",main="Cauchy process",col="purple",xlab="",ylab="")
plot(cou$time,cou$ou,type="p",pch=".",main="Cauchy-OU process",col="purple",xlab="",ylab="")
abline(h=0,lty="dotted",col="darkgrey") #median of limit distribution
dev.off()
{{Information |Description = A cauchy-process (levy-process) and an OU process driven by it. and the median of the invariant distribution |Source = created with GNU R, see source below |Date = 4. may 2007 |Author = Thomas Steiner |P