snssde(Sim.DiffProc)
snssde()所属R语言包:Sim.DiffProc
Numerical Solution of One-Dimensional SDE
一维SDE数值解
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Different methods of simulation of solutions to stochastic differential equations one-dimensional.
不同的方法模拟解决方案的一维随机微分方程。
用法----------Usage----------
snssde(N, M, T = 1, t0, x0, Dt, drift, diffusion, Output = FALSE,
Methods = c("SchEuler", "SchMilstein", "SchMilsteinS",
"SchTaylor", "SchHeun", "SchRK3"), ...)
参数----------Arguments----------
参数:N
size of process.
大小的处理。
参数:M
number of trajectories.
的轨迹数。
参数:T
final time.
最后的时间。
参数:t0
initial time.
初始时间。
参数:x0
initial value of the process at time t0.
初始值的过程中,在时间t0。
参数:Dt
time step of the simulation (discretization).
时间步长的仿真(discretization)。
参数:drift
drift coefficient: an expression of two variables t and x.
漂移:表达两个变量t和x。
参数:diffusion
diffusion coefficient: an expression of two variables t and x.
扩散系数:表达两个变量t和x。
参数:Output
if Output = TRUE write a Output to an Excel (.csv).
如果Output = TRUE写的Output到Excel(CSV)。
参数:Methods
method of simulation ,see details.
的模拟方法,see details。
参数:...
Details
详细信息----------Details----------
The function snssde returns a trajectory of the process; i.e., x0 and the new N simulated values if M = 1. For M > 1, an mts (multidimensional trajectories) is returned, which means that M independent trajectories are simulated. Dt the best discretization Dt = (T-t0)/N.
函数snssde返回轨迹的过程,也就是说,x0和新的N模拟值,如果M = 1。对于M > 1,MTS(多层面的轨迹),则返回,这意味着M独立的运动轨迹模拟。 Dt最好的离散Dt = (T-t0)/N。
Simulation methods are usually based on discrete approximations of the continuous solution to a stochastic differential equation. The methods of approximation are classified according to their different properties. Mainly two criteria of optimality are used in the literature: the strong and the weak (orders of) convergence. The methods of simulation can be one among: Euler Order 0.5 , Milstein Order 1 , Milstein Second-Order , Ito-Taylor Order 1.5 , Heun Order 2 , Runge-Kutta Order 3.
模拟方法通常是基于一个随机微分方程的连续解的离散近似。根据其不同的特性进行分类的方法近似。主要有两方面的最优标准文献中所使用的强与弱(订单)收敛。 methods模拟中的一个:Euler Order 0.5,Milstein Order 1,Milstein Second-Order,Ito-Taylor Order 1.5,Heun Order 2,Runge-Kutta Order 3。
值----------Value----------
data.frame(time,x) and plot of process.
数据框(时间,x)和图的过程。
注意----------Note----------
If methods is not specified, it is assumed to be the Euler Scheme.
如果methods没有被指定,它被假定为是Euler Scheme。
If T and t0 specified, the best discretization Dt = (T-t0)/N.
如果T和t0指定的,最好的离散Dt = (T-t0)/N。
(作者)----------Author(s)----------
Boukhetala Kamal, Guidoum Arsalane.
参见----------See Also----------
diffBridge Creating Diffusion Bridge Models.PredCorr Predictor-Corrector Method for one-dimensional SDE. snssde2D numerical solution of two-dimensional SDE. PredCorr2D predictor-corrector method for two-dimensional SDE, snssde3D numerical solution of three-dimensional SDE, PredCorr3D Predictor-Corrector Method for three-dimensional SDE.
diffBridge的创建扩散桥模型。PredCorr预测校正法的一维SDE。 snssde2D数值解二维SDE。 PredCorr2D预报 - 校正方法二维SDE,snssde3D数值解三维SDE,PredCorr3D的预测校正方法的用于三维SDE。
实例----------Examples----------
## example 1[#示例1]
## Hull-White/Vasicek Model[#Hull-White/Vasicek型号]
## T = 1 , t0 = 0 and N = 1000 ===> Dt = 0.001 [#T = 1时,T0 = 0,N = 1000 ===> DT = 0.001]
drift <- expression( (3*(2-x)) )
diffusion <- expression( (2) )
snssde(N=1000,M=1,T=1,t0=0,x0=10,Dt=0.001,
drift,diffusion,Output=FALSE)
Multiple trajectories of the OU process by Euler Scheme
snssde(N=1000,M=5,T=1,t0=0,x0=10,Dt=0.001,
drift,diffusion,Output=FALSE)
## example 2[#示例2]
## Black-Scholes models[#布莱克 - 斯科尔斯模型]
## T = 1 , t0 = 0 and N = 1000 ===> Dt = 0.001 [#T = 1时,T0 = 0,N = 1000 ===> DT = 0.001]
drift <- expression( (3*x) )
diffusion <- expression( (2*x) )
snssde(N=1000,M=1,T=1,t0=0,x0=10,Dt=0.001,drift,
diffusion,Output=FALSE,Methods="SchMilstein")
## example 3[#示例3]
## Constant Elasticity of Variance (CEV) Models[#常方差弹性(CEV)模型]
## T = 1 , t0 = 0 and N = 1000 ===> Dt = 0.001 [#T = 1时,T0 = 0,N = 1000 ===> DT = 0.001]
drift <- expression( (0.3*x) )
diffusion <- expression( (0.2*x^0.75) )
snssde(N=1000,M=1,T=1,t0=0,x0=1,Dt=0.001,drift,
diffusion,Output=FALSE,Methods="SchMilsteinS")
## example 4[#示例4]
## sde\ dX(t)=(0.03*t*X(t)-X(t)^3)*dt+0.1*dW(t)[#SDE \ DX(T)=(0.03 * T * X(T)(T)-X ^ 3)* dt值+0.1 * DW(T)]
## T = 100 , t0 = 0 and N = 1000 ===> Dt = 0.1 [#T = 100中,t0 = 0和N = 1000 ===> Dt的= 0.1]
drift <- expression( (0.03*t*x-x^3) )
diffusion <- expression( (0.1) )
snssde(N=1000,M=1,T=100,t0=0,x0=0,Dt=0.1,drift,
diffusion,Output=FALSE,Methods="SchTaylor")
## example 5[#示例5]
## sde\ dX(t)=cos(t*x)*dt+sin(t*x)*dW(t) by Heun Scheme[#SDE \ DX(T)= COS(T * X)* DT +罪(T * X)* DW(t)的威享计划]
drift <- expression( (cos(t*x)) )
diffusion <- expression( (sin(t*x)) )
snssde(N=1000,M=1,T=100,t0=0,x0=0,Dt=0.1,drift,
diffusion,Output=FALSE,Methods="SchHeun")
## example 6[#示例6]
## sde\ dX(t)=exp(t)*dt+tan(t)*dW(t) by Runge-Kutta Scheme[#SDE \ DX(T)= EXP(T)(T * DT +棕褐色)* DW(t)的龙格 - 库塔计划]
drift <- expression( (exp(t)) )
diffusion <- expression( (tan(t)) )
snssde(N=1000,M=1,T=1,t0=0,x0=1,Dt=0.001,drift,
diffusion,Output=FALSE,Methods="SchRK3")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|