Giter Site home page Giter Site logo

T Distribution Weirdness about distfit HOT 2 CLOSED

angelgeek avatar angelgeek commented on May 24, 2024
T Distribution Weirdness

from distfit.

Comments (2)

erdogant avatar erdogant commented on May 24, 2024

Maybe I missed this one but I store all the parameters returned after the distribution fitting.

As an example:

from distfit import distfit
X = np.random.normal(0, 2, 1000)
y = [-8, -6, 0, 1, 2, 3, 4, 5, 6]
dist = distfit(stats='ks', distr=['expon', 't', 'gamma', 'lognorm'])
results = dist.fit_transform(X)

print(dist.model)
{'distr': <scipy.stats._continuous_distns.t_gen at 0x2d4882810f0>,
 'stats': 'ks',
 'params': (3518324.248643998, -0.08180702912809554, 2.0838347069246876),
 'name': 't',
 'model': <scipy.stats._distn_infrastructure.rv_continuous_frozen at 0x2d49debda80>,
 'score': 0.40237077133797083,
 'loc': -0.08180702912809554,
 'scale': 2.0838347069246876,
 'arg': (3518324.248643998,),
 'CII_min_alpha': -3.5094110072794593,
 'CII_max_alpha': 3.345796949023267}

When I now do the fit manually for only the t-distribution, the following parameters are returned:

import scipy.stats as st
# fit dist to data
params = st.t.fit(X)
print(params)
(3518324.248643998, -0.08180702912809554, 2.0838347069246876)

# Separate parts of parameters
arg = params[:-2]
loc = params[-2]
scale = params[-1]

If I now compare the returned parameters and the stored ones in distfit, it is exactly the same:

params==dist.model['params']
True

from distfit.

erdogant avatar erdogant commented on May 24, 2024

I am closing this issue. Reopen if required.

from distfit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.