ptmvtnorm.marginal(tmvtnorm)
ptmvtnorm.marginal()所属R语言包:tmvtnorm
One-dimensional marginal CDF function for a Truncated Multivariate Normal and Student t distribution
的截断多元正态和Student t分布的一维边缘CDF功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function computes the one-dimensional marginal probability function from a Truncated Multivariate Normal and Student t density function using integration in pmvnorm() and pmvt().
此函数计算一维的边际的概率函数从一个被截断的多元正态和Student t密度函数使用集成在pmvnorm()和pmvt()。
用法----------Usage----------
ptmvnorm.marginal(xn,
n = 1,
mean = rep(0, nrow(sigma)),
sigma = diag(length(mean)),
lower = rep(-Inf, length = length(mean)),
upper = rep(Inf, length = length(mean)))
ptmvt.marginal(xn,
n = 1,
mean = rep(0, nrow(sigma)),
sigma = diag(length(mean)),
df = 1,
lower = rep(-Inf, length = length(mean)),
upper = rep(Inf, length = length(mean)))
参数----------Arguments----------
参数:xn
Vector of quantiles to calculate the marginal probability for.
向量的位数来计算边缘概率。
参数:n
Index position (1..k) within the random vector xn to calculate the one-dimensional marginal probability for.
计算一维的边际概率为索引的位置(1 .. k)于随机向量XN。
参数:mean
the mean vector of length k.
长度为k的平均向量。
参数:sigma
the covariance matrix of dimension k. Either corr or sigma can be specified. If sigma is given, the problem is standardized. If neither corr nor sigma is given, the identity matrix is used for sigma.
协方差矩阵的维数k。无论是corr或sigma可以指定。 sigma如果,问题是标准化的。如果没有corr,也不sigma,单位矩阵用于sigma。
参数:df
degrees of freedom parameter
度的自由参数
参数:lower
Vector of lower truncation points, default is rep(-Inf, length = length(mean)).
矢量较低的截断点,默认是rep(-Inf, length = length(mean))。
参数:upper
Vector of upper truncation points, default is rep( Inf, length = length(mean)).
向量上的截断点,默认是rep( Inf, length = length(mean))。
Details
详细信息----------Details----------
The one-dimensional marginal probability for index i is F_i(x_i) = P(X_i <= x_i)
一维的索引i的边际概率是F_i(x_i) = P(X_i <= x_i)
where u = (b_1,...,b_{i-1},x_i,b_{i+1},...,b_k)' is the upper integration bound and Φ_k is the k-dimensional normal probability (i.e. functions pmvnorm() and pmvt() in R package mvtnorm).
其中u = (b_1,...,b_{i-1},x_i,b_{i+1},...,b_k)'是上集成约束和Φ_k是k维正态概率(即函数pmvnorm()和pmvt()R封装mvtnorm)。
值----------Value----------
Returns a vector of the same length as xn with probabilities.
返回一个向量,具有相同的长度为xn与概率。
(作者)----------Author(s)----------
Stefan Wilhelm <Stefan.Wilhelm@financial.com>
实例----------Examples----------
## Example 1: Truncated multi-normal[例1:截断多正常]
lower=c(-1,-1,-1)
upper=c(1,1,1)
mean=c(0,0,0)
sigma=matrix(c(1, 0.8, 0.2,
0.8, 1, 0.1,
0.2, 0.1, 1), 3, 3)
X = rtmvnorm(n=1000, mean=c(0,0,0), sigma=sigma, lower=lower, upper=upper)
x = seq(-1, 1, by=0.001)
Fx = ptmvnorm.marginal(xn=x, n=1, mean=c(0,0,0), sigma=sigma, lower=lower, upper=upper)
plot(ecdf(X[,1]), main="marginal CDF for truncated multi-normal")
lines(x, Fx, type="l", col="blue")
## Example 2: Truncated multi-t[例2:截断多笔]
X = rtmvt(n=1000, mean=c(0,0,0), sigma=sigma, df=2, lower=lower, upper=upper)
x = seq(-1, 1, by=0.001)
Fx = ptmvt.marginal(xn=x, n=1, mean=c(0,0,0), sigma=sigma, lower=lower, upper=upper)
plot(ecdf(X[,1]), main="marginal CDF for truncated multi-t")
lines(x, Fx, type="l", col="blue")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|