全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2255 1
2009-12-09
这是一段模拟计算Va的程序,可是只能出来最后结果,我想显示出模拟的10000个数值,该如何操作?谢谢
因为这是GPD分布,用bivd模拟不知道如何写函数名,和参数

程序如下,期盼能够帮忙解惑,谢谢了
> VaR.out = VaR.exp.sim(n=10000,Q=c(0.01,0.05),
+ copula=cop.normal.fit$copula,
+ x.est=gpd.bmw.fit2,
+ y.est=gpd.siemens.fit2,
+ lambda1=0.7,
+ lambda2=0.3)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-2-3 15:26:22
你看是不是这样的——


#calculating VaR requires S-PLUS 7.0 and S+FinMetrics 2.0.
# compute log-returns
DowJones30.ret = getReturns(DowJones30)
# compute equally weighted portfolio return
w = rep(1,30)/30
port.ret.ts = rowSums(DowJones30.ret, weights=w)
#
# Extreme Value Theory
#
# compute mean excess plots for negative returns
# threshold appears to be near 0.015
par(mfrow=c(2,1))
tmp = meplot(-port.ret.ts)
shape.plot(-port.ret.ts, from=0.9, to=0.98)
par(mfrow=c(1,1))

# estimate parameters of GPD with u = 0.015
gpd.fit = gpd(-port.ret.ts, threshold=0.015)
gpd.fit
tailplot(gpd.fit)

# compute 1% VaR and ETL from fitted GPD
riskmeasures(gpd.fit, p=0.99)
gpd.q(pp=0.99, ci.p = 0.95, plot=F)
gpd.sfall(pp=0.99, ci.p = 0.95, plot=F)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群