我希望对我拥有的数据集进行加权分布拟合。
我目前正在使用fitdist命令,但不知道是否有一种方法可以添加加权。
library(fitdistrplus)
df<-data.frame(value=rlnorm(100,1,0.5),weight=runif(100,0,2))
#This is what I'm doing but not really what I want
fit_df<-fitdist(df$value,"lnorm")
#How to do this
fit_df_weighted<-fitdist(df$value,"lnorm",weight=df$weight)
我确定这个问题之前已经有人回答过了,但我找不到任何相关的内容。 提前感谢您的帮助。 Gordon
my_vector=width(df, rep(value, round(weight*10000)))
。 - thias