R的truncdist包支持哪些发行版?
R的truncdist包支持哪些发行版?,r,distribution,specifications,truncated,R,Distribution,Specifications,Truncated,truncdist包中的各种功能都需要参数“spec”。这些函数支持哪些分布 我的意思是,对于正态分布,我们可以键入spec=“norm”(示例中给出)。但是,其他发行版呢 对于其他发行版,我必须在spec中键入什么/支持的发行版列表是什么?它似乎支持Rstats包中的所有发行版:因为truncdist包中的函数在调用前加上了“d”和“p”: g <- get(paste("d", spec, sep = ""), mode = "function") G <- get(paste(
truncdist
包中的各种功能都需要参数“spec
”。这些函数支持哪些分布
我的意思是,对于正态分布,我们可以键入spec=“norm”
(示例中给出)。但是,其他发行版呢
对于其他发行版,我必须在spec中键入什么/支持的发行版列表是什么?它似乎支持R
stats
包中的所有发行版:因为truncdist
包中的函数在调用前加上了“d”和“p”:
g <- get(paste("d", spec, sep = ""), mode = "function")
G <- get(paste("p", spec, sep = ""), mode = "function")
g实际上,truncdist
看起来根本不检查实际的“分布”。它只是在作为spec=…
传递的任何内容前面加上d和p。因此,只要已加载,您就可以使用任何包中的任何分发。例如,VGAM
包有大量不在基本R中的发行版。如果加载了VGAM
,所有这些发行版都可以与truncdist
一起使用
library(truncdist) # for dtrunc(....)
library(VGAM) # for slash(...)
x <- seq(-5,5,0.01)
Y <- dslash(x) # slash is dist of Z=Y/X where Y~N[0,1] and X~U[0,1]
Z <- dtrunc(x,spec="slash", a=-2, b=2)
plot(x,Y,xlim=c(-5,5),ylim=c(0,.4), type="l",col="blue")
lines(x,Z,xlim=c(-5,5),col="red")
library(truncdist)#用于dtrunc(..)
库(VGAM)#用于斜杠(…)
x如果不清楚,您只需使用分发基础名称(即指定weibull
而不是pweibull
或dweibull
)好的,我想我们可以使用此列表中的规范。