Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:10:48+00:00 2026-06-07T21:10:48+00:00

I need to fit my data into a Beta distribution and retrieve the alpha

  • 0

I need to fit my data into a Beta distribution and retrieve the alpha parameter. I’m trying to use R from python (rpy2) and my code looks like:

from rpy2 import *
from rpy2.robjects.packages import importr
MASS = importr('MASS') #myVector is a Numpy array with values between 0 and 1
MASS.fitdistr(myVector,"beta")

But I get this error:

Error in function (x, densfun, start, ...)  : 
  'start' must be a named list
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/rpy2/robjects/functions.py", line 82, in __call__
    return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/rpy2/robjects/functions.py", line 34, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in function (x, densfun, start, ...)  : 
  'start' must be a named list

I can’t seem to find any good documentation for R with detailed examples, so I only found this:

start A named list giving the parameters to be optimized with initial values. This can be omitted for some of the named
distributions (see Details). … Additional parameters, either for
densfun or for optim. In particular, it can be used to specify bounds
via lower or upper or both. If arguments of densfun (or the density
function corresponding to a character-string specification) are
included they will be held fixed.

I really have no clue as to:

  • what to put as a starting parameters and how that will affect my estimation
  • what syntax to use in Python, since start=list(shape1=0.5, shape2=0.5) won’t do the trick

Any hint?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:10:49+00:00Added an answer on June 7, 2026 at 9:10 pm

    Ok, after a little bit more of digging, I found a solution:

    from rpy2.robjects import DataFrame
    starter= DataFrame({'shape1':0.5,'shape2':0.5})
    x = MASS.fitdistr(myValues, "beta", start=starter))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data with a best fit line draw. I need to draw two
I need to dynamically load content from HTML emails into some type of content
SLIGHT UPDATE BELOW I am trying to use the [Description] data annotation attribute with
I need to be able to turn a flat xml data sets into html
I'm trying to populate a table structure with around 5 fields of data from
I'm trying to build a dynamic table using PHP to insert data from a
I need to fit two video streams on to each other. I need to
I need to adjust my jqgrid height dynamically to fit in the browser window
Need some regular expressions help. So far I have my code working to allow
I need to fit a certain bounds within a map. I get the bounds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.