I am trying to fit a negative binominal distribution to a dataset that only has one field and that field is the number of words in a sentence. How do I fit the distribution using statsmodels.discrete.discrete_mode
How to fit a negative binominal model to data using maximum likelihood estimation
914 Views Asked by Mark Sweetner At
1
There are 1 best solutions below
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in STATISTICS
- How to make pandas show large datasets in output?
- How to construct polygons from a 2D data to compute spatial autocorrelation in R
- Is python statsmodel elastic net regression automatically standard deviation deflated?
- How can I emulate Microsoft Excel's Solver functionality (GRG Nonlinear) in python?
- How do I find the probability that one of my probabilities will occur?
- Timeline-ish data to Occurence/Exposure data
- Handling Error Propagation Above Biological Thresholds in R with predictNLS
- Why is there such a difference between chi2 and mcnemar?
- Handling Nested One-Level Random Effects in Linear Mixed Models in R
- Model failed to converge (gamma model, self-paced reading data)
- How to quantify the consistency of a sequence of predictions, incl. prediction confidence, using standard function from sklearn or a similar library
- P-values for each comparison in a Kruskal post hoc test in R?
- R Metaprop P-value overlapping with forest plot axes
- Monte Carlo simulation Lotto Germany
- How does emmeans adjust the p-values when using "Tukey" as adjustment method? (Solved)
Related Questions in CURVE-FITTING
- Mismatch between fitting curve and origin data
- Why does SciPy minimize return different solutions when minimizing sum of squared error versus root mean squared error?
- How can I fit my data better or shift my data? My fit is way below my data
- How to exclude abnormal data points and smooth the data before linear fitting
- Pyton curve fit returns completely wrong values for cosine wave
- Best fit of an increasing function that becomes constant
- Finding outlier points of a curve
- How is Maxfunevals used in the fit function of MATLAB
- How can I fit data to a Lennard-Jones potential in Gnuplot?
- Power law fit doesn't work in python: it's either way off or returns only the starting parameters
- Scipy's Curve Fit Can't Find Optimal Parameters
- Is there a function/approach to compare discrete with continuous data to calculate the x-shift needed to overlay them?
- Fitting Variable Number of Lorentzian Peaks to a glob of data in text files
- Fit for a parameter when the function is obtained by numerical integration in Python
- How to fit a logistic distribution use a fixed location parameter?
Related Questions in DATA-FITTING
- Create Symbolic Function from Double Vector MATLAB
- Why does SciPy minimize return different solutions when minimizing sum of squared error versus root mean squared error?
- Can I add a logic constraint (<,>) to an ipfp argument? („mipfp“)
- In R, how to fit variables (A,B and C) in the same column such as A and B and also A and C in the same panel?
- How can I find the date for which a model from family = poisson(link = "log") predicts a specified value?
- How can I find the date for which a model predicts a specified value?
- Find best fit common probability density function, if already have a probability density function (Python's Fitter does not suffice)
- L-BFGS-B Needs Finite Falue of 'fn' (In one step (step) and (step -1 +dstep))
- Fit two constrained circular caps to data
- Fitting data with a three-parameter Weibull distribution function
- Fitting data for an implicit function with 2 parameters
- Combined fit of two distributions
- How to centre observational data onto predicted isochrone data in Python
- Math.NET 6th order polynomial fit returns infinity and NaN as parameters
- I got this TypeError: '<' not supported between instances of 'str' and 'NoneType' while fitting the training data for logistic regression. Why?
Related Questions in BINOMIAL-THEOREM
- Expanding polonomial expressions in r (Binomial, trinomial, quadronomial, etc) into vectors?
- Finding character at particular location of String
- Mean and Standard Deviation of x>=5 of 10000 data points binomial(10, 1/4)
- Binomial Options Pricing Calculation in PowerQuery
- How can I have both commas and brackets while printing a list? (Python)
- How to fit a negative binominal model to data using maximum likelihood estimation
- Binomial formula implementation for matrices of different dimensions
- Use of Binomial Theorem in IP address distribution
- Vectorized approach for calculating numerator for generalized binomial theorem?
- Binomial distribution to return an Numpy array
- Negative binomial cumulative distribution frequency in Python 3 to find the probability of having less than or equal to x successes
- Binomial distribution series in C Programming
- loop for binom.test() in r
- Binomial Distribution with numpy, python and pandas.Sample Input: 0 10 0.5. Sample output: [5 6 5 5 5 6 5 7 8 5]
- Time Complexity of Finding All Possible Sub Array of an Array
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think that statsmodels class is just meant to be a backend asset for regression models, and not for fitting distributions. See the reference here: Regression with Discrete Dependent Variable
But in an answer in an other question here, there is a link, with a possible workaround to exploit the statsmodels regression model, to fit your distribution: Newbie question about discrete distributions and MLE
I have looked at scipy.stats.nbinom as well for you, as scipy has the MLE fitting methods for all kinds of distributions. But the discrete distributions do not have fitting methods. There are numerous answers here explaining the difficulties with that, and some alternative approaches:
As an alternative possibility besides the ones mentioned in the above answers, I can advise you to check out Bayesian numerical methods with the PyMC3 package, as that includes a Negative Binomial distribution as well.