gpt4 book ai didi

r - 如何使用 r 识别给定数据的分布

转载 作者:行者123 更新时间:2023-12-02 02:51:02 25 4
gpt4 key购买 nike

我有如下数据,我需要确定数据的分布。请帮忙。

 x <-  c(37.50,46.79,48.30,46.04,43.40,39.25,38.49,49.51,40.38,36.98,40.00,38.49,37.74,47.92,44.53,44.91,44.91,40.00,41.51,47.92,36.98,43.40)

最佳答案

一个巧妙的方法是使用 fitdistrplus 包来提供分布拟合工具。以您的数据为例。

library(fitdistrplus)
descdist(x, discrete = FALSE)

enter image description here

现在您可以尝试适应不同的分布。例如:

normal_dist <- fitdist(x, "norm")

腹肌随后检查是否合身:

plot(normal_dist)

Fitting

<小时/>

作为一个通用点,我建议您查看 this discussion在交叉验证中,详细讨论了该主题。您可能还愿意查看 Deligette-Muller 和 Dutang 撰写的论文 - fitdistrplus: An R Package for Fitting Distributions,可用 here如果您有兴趣了解如何使用 Cullen 和 Frey 图的更详细说明。

关于r - 如何使用 r 识别给定数据的分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31741742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com