我正在使用以下代码来适应正态分布."b"(太大而不能直接发布)的数据集链接是:
setwd("xxxxxx")
library(fitdistrplus)
require(MASS)
tazur <-read.csv("b", header= TRUE, sep=",")
claims<-tazur$b
a<-log(claims)
plot(hist(a))
Run Code Online (Sandbox Code Playgroud)
绘制直方图后,似乎正态分布应该很好.
f1n <- fitdistr(claims,"normal")
summary(f1n)
#Length Class  Mode   
#estimate 2      -none- numeric
#sd       2      -none- numeric
#vcov     4      -none- numeric
#n        1      -none- numeric
#loglik   1      -none- numeric
plot(f1n)
Run Code Online (Sandbox Code Playgroud)
xy.coords(x,y,xlabel,ylabel,log)中的错误:
'x'是一个列表,但没有组件'x'和'y'
当我尝试绘制拟合分布时,我得到上述错误,甚至f1n的摘要统计信息都没有.
非常感谢任何帮助.