我正在尝试建模一些数据.我的Excel运气比R好,但Excel解决方案不会扩展所以我需要在R中计算如何做到这一点.
Excel将趋势线映射到数据,功率曲线产生合理的y = 0.6462x ^ -0.542.
当我将相同的数据放入R并尝试使用包中的连续幂律对其进行建模时,poweRlaw我会得到类似的结果y = 0.14901x^-3.03671.拦截太小了,而且alpha太大了.
# 14 days of % of users retained
y = c(0.61431 , 0.42585 , 0.35427 , 0.33893 , 0.28853 , 0.26004 , 0.2352 , 0.20087 , 0.17969 , 0.1848 , 0.17311 , 0.17092 , 0.15777 , 0.14901)
y.pl = conpl$new(y)
y.pl_est = estimate_xmin(c_pl)
y.pl_est
# $KS
# 0.1068587
#
# $xmin
# 0.14901
#
# $pars
# 3.03673
#
# $ntail
# 14
Run Code Online (Sandbox Code Playgroud)
有没有办法使用lm或glm …