全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
5843 1
2008-03-10

       我想应用pot模型参数估计, 其中有个超额均值函数图, 以及超额数按gpd分布拟合后的残差与指数分布的q-q图

    这两个图形怎么画呢?

    谢谢了;)

二维码

扫码加我 拉你入群

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

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

全部回复
2014-12-28 22:07:29
POT package  
完整例子,肯定够用了——
##Simulate a sample from a GPD(0,1,0.2):
x <- rgpd(100, 0, 1, 0.2)
##Evaluate density at x=3 and probability of non-exceedance:
dgpd(3, 0, 1, 0.2); pgpd(3, 0, 1, 0.2)
##Compute the quantile with non-exceedance probability 0.95:
qgpd(0.95, 0, 1, 0.2)
##What about the bivariate case? Just the same
y <- rbvgpd(100, model = "alog", alpha = 0.2, asCoef1 = 0.8, asCoef2 = 0.2, mar1 = c(0, 1, 0.2), mar2 = c(10, 1, 0.5))
##Evaluate the probability to not exceed (5,14)
pbvgpd(c(3,15), model = "alog", alpha = 0.2, asCoef1 = 0.8, asCoef2 = 0.2, mar1 = c(0, 1, 0.2), mar2 = c(10, 1, 0.5))

##Maximum likelihood estimate (threshold = 0):
mle <- fitgpd(x, 0)
##Probability Weighted Moments:
pwu <- fitgpd(x, 0, "pwmu")
##Maximum Goodness-of-Fit estimators:
adr <- fitgpd(x, 0, "mgf", stat = "ADR")
##Specifying a known parameter:
fitgpd(x, 0, "mple", shape = 0.2)
##Specifying starting values for numerical optimizations:
fitgpd(x, 0, "mdpd", start = list(scale = 1, shape = 0.2))
##Fit a bivariate GPD with a logistic dependence:
log <- fitbvgpd(y, c(0,10), "log")

##Generic function for the univariate and bivariate cases:
plot(mle); plot(log)
##Return level plots:
retlev(mle, npy = 2); retlev(log)
##Probability-Probability and Q-Q plots:
pp(mle); qq(mle)
##Plot the density:
dens(mle)
##Plot the Pickands' dependence function:
pickdep(log)
##Spectral density plot:
specdens(log)
##Profile Likelihood (quantiles):
confint(mle, prob = 0.95)
##Profile Likelihood (parameters):
confint(mle, "scale"); confint(mle, "shape")


二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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