SuppDists 包中有一个 Johnson 发行版。 Johnson 将为您提供与矩或分位数匹配的分布。其他人的评论是正确的,4 个时刻不是一个分布。但约翰逊肯定会尝试。
以下是将 Johnson 拟合到一些样本数据的示例:
require(SuppDists)
## make a weird dist with Kurtosis and Skew
a <- rnorm( 5000, 0, 2 )
b <- rnorm( 1000, -2, 4 )
c <- rnorm( 3000, 4, 4 )
babyGotKurtosis <- c( a, b, c )
hist( babyGotKurtosis , freq=FALSE)
## Fit a Johnson distribution to the data
## TODO: Insert Johnson joke here
parms<-JohnsonFit(babyGotKurtosis, moment="find")
## Print out the parameters
sJohnson(parms)
## add the Johnson function to the histogram
plot(function(x)dJohnson(x,parms), -20, 20, add=TRUE, col="red")
最终的情节如下所示:
您可以看到其他人指出的关于 4 个矩如何不能完全捕获分布的一些问题。
祝你好运!
EDIT正如哈德利在评论中指出的那样,约翰逊的状态看起来不太好。我做了一个快速测试并使用拟合约翰逊分布moment="quant"
它使用 5 个分位数而不是 4 个矩来拟合约翰逊分布。结果看起来好多了:
parms<-JohnsonFit(babyGotKurtosis, moment="quant")
plot(function(x)dJohnson(x,parms), -20, 20, add=TRUE, col="red")
产生以下结果:
有人知道为什么约翰逊在适合使用时刻时似乎有偏见吗?