【发布时间】:2019-03-28 17:05:24
【问题描述】:
我有一个带有变量 X 和 Y 的 Clayton Copula,我想得到联合概率和条件概率 P(X≤x, Y≤y) 和 P(X≤x|Y≤y)。例如,X 低于其第一个百分位的概率以 Y 低于其第一个百分位为条件:P(X≤1%|Y≤1%)
我尝试过使用 R prob() 函数,但我不确定输出。
library(VineCopula)
library(copula)
#I estimate my Copula and assumes normal distribution for the two marginals
copula_dist <- mvdc(copula=claytonCopula(param=1.0), margins=c("norm","norm"),
paramMargins=list(list(mean=0, sd=5),list(mean=0, sd=5)))
#I take a sample of 500 events
sim <- rMvdc(500,copula_dist)
# Compute the density
pdf_mvd <- dMvdc(sim, my_dist)
# Compute the CDF
cdf_mvd <- pMvdc(sim, my_dist)
#I wonder whether this gives me the proba P(X<0.01|Y<0.01)
prob(claytonCopula(param=1.0), c(0,.01),c(0,0.01))
我得到 25.26% 作为输出,但我不确定它是否正确。
【问题讨论】:
标签: r probability