找回密码
 注册
查看: 389|回复: 0

R语言 schwartz97包 rand-state()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 22:54:34 | 显示全部楼层 |阅读模式
rand-state(schwartz97)
rand-state()所属R语言包:schwartz97

                                        Schwartz two-factor Model: Sampling from the State Variables
                                         施瓦茨双因素模型:从状态变量抽样

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Random number and trajectory generation of the state variables. The state variables are the commodity spot price s0 and the spot convenience yield delta0. The commodity log spot price and the convenience yield follow a bivariate normal distribution.
状态变量的随机数和轨迹生成。状态变量的大宗商品现货价格s0和当场便利收益delta0。商品log现货价格和便利收益的二元正态分布。


用法----------Usage----------



## S4 method for signature 'ANY,ANY,numeric'
rstate(n, time = 1, s0 = 50, delta0 = 0,
       mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0,
       sigmaE = 0.5, rho = 0.75, method = "chol")

## S4 method for signature 'ANY,ANY,schwartz2f'
rstate(n, time = 1, s0, method = "chol")

## S4 method for signature 'ANY,ANY,numeric'
simstate(n, time = 1, s0 = 50, delta0 = 0,
         mu = 0.1, sigmaS = 0.3, kappa = 1, alpha = 0,
         sigmaE = 0.5, rho = 0.75, method = "chol")

## S4 method for signature 'ANY,ANY,schwartz2f'
simstate(n, time = 1, s0, method = "chol")




参数----------Arguments----------

参数:n
Number of observations.
若干意见。


参数:time
at which random numbers of the state variables are drawn (rstate) or horizon of the trajectory (simstate) relative to now.
的状态变量的随机数绘制(rstate)或轨迹的地平线(simstate)与现在相对。


参数:s0
Either a numeric representing the initial value of the commodity spot price or an object inheriting from class schwartz2f.
一个numeric代表的大宗商品现货价格的初始值或对象继承类schwartz2f。


参数:delta0
Initial value of the convenience yield.
便利收益的初始值。


参数:mu
enters the drift of the commodity spot price.
进入漂移的大宗商品现货价格。


参数:sigmaS
Diffusion parameter of the spot price-process.
现货价格过程的扩散参数。


参数:kappa
Speed of mean-reversion of the convenience yield process.
均值回归的便利收益过程的速度。


参数:alpha
Mean-level of the convenience yield process.
平均数级的便利收益过程。


参数:sigmaE
Diffusion parameter of the convenience yield process.
便利收益过程中的扩散参数。


参数:rho
Correlation coefficient between the Brownian motion driving the spot price and the convenience yield process.
之间的相关系数的布朗运动驱动的现货价格和便利收益的过程。


参数:method
See rmvnorm of package mvtnorm.
请参阅rmvnorm包mvtnorm。


Details

详细信息----------Details----------

The model and its parameters are described in the Details section of the schwartz2f-class documentation and in the package vignette Technical Document.
该模型及其参数的描述,在“详细信息”部分的schwartz2f级的文件和技术文件包中的小插曲。

The above methods rely on the functions pmvnorm, dmvnorm, qmvnorm and rmvnorm of the package mvtnorm.
依靠上述方法的功能pmvnorm,dmvnorm,qmvnorm和rmvnorm包mvtnorm。


值----------Value----------

Samples or trajectories of the commodity spot price and instantaneous spot convenience yield as matrix.
样品或大宗商品现货价格和便利收益matrix瞬时点的运动轨迹。


(作者)----------Author(s)----------


Philipp Erb, David Luethi, Juri Hinz



参见----------See Also----------

schwartz2f-class description. d/p/q/state for the density, distribution, and quantile function of the state variables.
schwartz2f类的描述。 d/p/q/state的密度,分布和分位数函数的状态变量。


实例----------Examples----------


## Create a "schwartz2f"-object[#创建的“schwartz2f”。对象]
model <- schwartz2f()

## and sample from its distribution at time = 2.5.[#和其分布在时间= 2.5的样品。]
sim <- rstate(n = 1000, s0 = model, time = 2.5)
par(mfrow = c(1, 2))
hist(sim[,1], main = "Distribution of Spot Price")
hist(sim[,2], main = "Distribution of Convenience Yield")


## Create a trajectory over a 6 years horizon sampled on a weekly basis.[#创建一个过了6年地平线上每周采样轨迹。]
trajectory <- simstate(6 * 52, time = 6, s0 = model)
par(mfrow = c(1, 2))
plot(trajectory[,1], main = "Spot Price", type = "l")
plot(trajectory[,2], main = "Convenience Yield", type = "l")


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-15 00:04 , Processed in 0.030638 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表