楼主: 江夏雁
7508 18

[问答] fitdistr 函数如何使用? [推广有奖]

11
maths_hjxk 发表于 2020-6-20 13:07:17
(1)不同的初始值可能会得到不同的极大值,实际中应该多试几次,能稳定最好。
(2)
  1. uui$estimate[1]和 uui$estimate[2]
复制代码

12
maths_hjxk 发表于 2020-6-20 13:08:36
  1. uui$estimate[1]和uui$estimate[2]
复制代码

13
江夏雁 在职认证  发表于 2020-6-20 13:11:03
maths_hjxk 发表于 2020-6-20 12:56
我想起来你说的CASS包,其实是MASS包,里面有个函数fitdistr一样可以估计
start=list(shape1 =4, shape2  ...
你好!
c<-c(0.1 0.1 0.2 0.2 0.2 0.2 0.3 0.6)
uui<- fitdist(c, distr="beta", method = "mle",start=NULL, fix.arg=NULL)
方便你用,
我用的例子在上面,期待你的见解!
多谢!

14
江夏雁 在职认证  发表于 2020-6-20 13:11:08
maths_hjxk 发表于 2020-6-20 12:56
我想起来你说的CASS包,其实是MASS包,里面有个函数fitdistr一样可以估计
start=list(shape1 =4, shape2  ...
你好!
c<-c(0.1 0.1 0.2 0.2 0.2 0.2 0.3 0.6)
uui<- fitdist(c, distr="beta", method = "mle",start=NULL, fix.arg=NULL)
方便你用,
我用的例子在上面,期待你的见解!
多谢!

15
江夏雁 在职认证  发表于 2020-6-20 13:12:37
maths_hjxk 发表于 2020-6-20 13:08
你好! 我尝试了
> uui$estimate[1]
  shape1
2.265435
还是不能取出 2.265 这个数字,
多谢!

16
maths_hjxk 发表于 2020-6-20 13:13:28
其实beta密度是单峰函数,理论上无论什么初值始结果都是一样的。

17
江夏雁 在职认证  发表于 2020-6-20 13:15:17
maths_hjxk 发表于 2020-6-20 13:08
我也试了
> uui$estimate[1]
  shape1
2.265435


> uui$estimate[1][1]
  shape1
2.265435

都是不能对别的变量赋值 ,因为都有“shape1”字样

18
江夏雁 在职认证  发表于 2020-6-20 13:19:12
maths_hjxk 发表于 2020-6-20 13:15
你似乎应该先入门一些R的基本常识
多谢指点!
> c<-c(0.1,0.1,0.2,0.2,0.2,0.2,0.3,0.6)
> uui<- fitdist(c, distr="beta", method = "mle",start=NULL, fix.arg=NULL)
> z<-c()
> z[1]<-uui$estimate[1]
> z
[1] 2.265435
>
也就是说虽然uui$estimate[1]  带有shape1字样,但是其实还是一个数字是吗?多谢!

19
maths_hjxk 发表于 2020-6-20 13:21:20
江夏雁 发表于 2020-6-20 13:19
多谢指点!
> c uui z z[1] z
[1] 2.265435
是的,一样可以进行计算。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 07:42