File:SQRTDiffusion4.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this preview: 800 × 600 pixels. Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 1,024 × 768 pixels | 1,200 × 900 pixels.
Original file (1,200 × 900 pixels, file size: 19 KB, MIME type: image/png)
File information
Structured data
Captions
DescriptionSQRTDiffusion4.png | three sample paths of an square root diffuion process (Cox Ingersol Ross), see SDE in the image. four different graphs with different parameters |
Date | |
Source | made with the free software R, see the source code at the bottom |
Author | Thomas Steiner |
Permission (Reusing this file) |
Thomas Steiner put it under the GFDL |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. | ||
| ||
This licensing tag was added to this file as part of the GFDL licensing update.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
R-Quelltext:
##SQRT-Diffusion mit normalverteiltem Anfangswert sdiff<-function(kappa=5, theta=0.6, sigma=0.2, init=c(1, 1), from=0, to=1.5, steps=1000*(to-from), bm=rnorm(n=steps-1,mean=0,sd=sqrt((to-from)/steps))) { t<-seq(from,to,length=steps) cir<-rnorm(n=1,mean=init[1],sd=sqrt(init[2])) for (i in (1:(steps-1))) { cir[i+1]=cir[i] + kappa*(theta-cir[i])*(to-from)/steps + sqrt(cir[i])*sigma*bm[i] } return(cir) } cols=c("navy", "darkolivegreen4", "red") set.seed(290184) kappa=5 theta=0.6 sigma=0.2 from=0 to=1.5 steps=1000*(to-from) w1=rnorm(n=steps-1,mean=0,sd=sqrt((to-from)/steps)) w2=rnorm(n=steps-1,mean=0,sd=sqrt((to-from)/steps)) w3=rnorm(n=steps-1,mean=0,sd=sqrt((to-from)/steps)) init=c(rnorm(1,1,1),0) t<-seq(from,to,length=steps) png(filename="SQRTDiffusion4.png", width=1200, height=900, pointsize=12) par(bg="lightgrey", mfrow=c(2,2), oma=c(0,0,3,0)) matplot(t,sdiff(init=c(0,0), bm=w1),type="l", xlab="", ylab="",col=cols[1], lwd=2, ylim=c(0,2)) lines(t,sdiff(init=c(2,0), bm=w2), col=cols[2], lwd=2) lines(t,sdiff(init=init, bm=w3), col=cols[3], lwd=2) text(x=1.35,y=1.9,expression(list(kappa==1, theta==1.2, sigma == 0.3)), cex=1.4 ) text(x=0,y=0.07, expression(X[0]==0),col=cols[1]) text(x=0,y=1.92, expression(X[0]==2),col=cols[2]) text(x=0,y=init[1]*1.08, expression(paste(X[0], "~N(1,1)") ),col=cols[3]) matplot(t,sdiff(theta=1.4, init=c(0,0), bm=w1),type="l", xlab="", ylab="",col=cols[1], lwd=2, ylim=c(0,2)) lines(t,sdiff(theta=1.4, init=c(2,0), bm=w2),col=cols[2], lwd=2) lines(t,sdiff(theta=1.4, init=init, bm=w3),col=cols[3], lwd=2) title(main=expression(theta==1.4)) matplot(t,sdiff(sigma=0.4, init=c(0,0), bm=w1),type="l", xlab="", ylab="",col=cols[1], lwd=2, ylim=c(0,2)) lines(t,sdiff(sigma=0.4, init=c(2,0), bm=w2),col=cols[2], lwd=2) lines(t,sdiff(sigma=0.4, init=init, bm=w3),col=cols[3], lwd=2) title(main=expression(sigma==0.4)) matplot(t,sdiff(theta=1, kappa=50, init=c(0,0), bm=w1),type="l", xlab="", ylab="",col=cols[1], lwd=2, ylim=c(0,2)) lines(t,sdiff(theta=1, kappa=50, init=c(2,0), bm=w2),col=cols[2], lwd=2) lines(t,sdiff(theta=1, kappa=50, init=init, bm=w3),col=cols[3], lwd=2) title(main=expression(list(theta==1, kappa==50))) title(main=expression(paste("d",X[t]==kappa(theta-X[t]),"dt+",sigma,sqrt(X[t]),"d", W[t])), cex.main=2.5, outer=TRUE) dev.off()
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 21:56, 21 December 2005 | 1,200 × 900 (19 KB) | Thire (talk | contribs) | {{Information| |Description = three sample paths of an square root diffuion process (Cox Ingersol Ross), see SDE in the image. four different graphs with different parameters |Source = made with the free software ''R'', see the source code at the bottom | |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on de.wikibooks.org