fitdistr in rpy2

有些话、适合烂在心里 提交于 2019-12-11 04:09:53

问题


I've a 1D list of data, that I want to fit into a distribution using either least squares or maximum likelihood, as presented here, but I want to do it from python instead of the R interactive shell.

I got rpy2 installed, and would like to use the fitdistr function from within the interactive ipython shell, as I have imported the data in a list.

Where is this function, and how do I use it?


回答1:


The function is in the R package MASS

from rpy2.robjects.packages import importr

MASS = importr('MASS')

# the function is now at MASS.fitdistr


来源:https://stackoverflow.com/questions/11163472/fitdistr-in-rpy2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!