fitdistr in rpy2

2019-07-14 02:04发布

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条回答
可以哭但决不认输i
2楼-- · 2019-07-14 02:19

The function is in the R package MASS

from rpy2.robjects.packages import importr

MASS = importr('MASS')

# the function is now at MASS.fitdistr
查看更多
登录 后发表回答