Giter Site home page Giter Site logo

Comments (3)

rc avatar rc commented on August 16, 2024

The above results are for ~10 repetitions of the smallest raw histogram item, see get_counts_from_lengths(). When this number is increased to 100, the results are essentially the same, also aic and bic for VonMisesMixture is higher, closer to that of VonMisesMixtureBinned. Due to much larger data, fitting with VonMisesMixture then takes ages to finish. Then for 300, the curves are virtually indistinguishable etc.

My conclusion: It is preferable to use VonMisesMixtureBinned, which is much faster, for the analysis, together with the basin-hopping solver (a few (~20) iterations seems to be sufficient) to avoid dependence on the initial guess.

from dist_mixtures.

josef-pkt avatar josef-pkt commented on August 16, 2024

VonMisesMixtureBinned with the original bin sizes from the raw data, is the "correct" approach given that the raw data are already binned. Since this is essentially fitting a histogram, I think, the parameter estimate is independent of the conversion to independent counts, but the inference still requires the sample size.
Did we normalize the sample size for VonsMisesMixtureBinned ?

statsmodels master now has a chisquare function, that tests that the deviation of the data from the estimated model has a minimal size. I was hoping this gives us better test results for the chisquare test, then the 0, 1 we get because of the larger sample size. (I'm going to look for it.)

I also ran the "fit_von_mises.py" script on top of my GenericLikelihood cleanup branch and it didn't change anything for this case.

Are we getting different results, parameters, with basinhopping than with just one set of starting values and bfgs?

from dist_mixtures.

rc avatar rc commented on August 16, 2024

The VonsMisesMixtureBinned instance is created in analyses.fit_mixture.fit() - it uses the raw data, only the angles are transformed from [-90, 90[ to [-pi, pi[.

Mostly basinhopping and bfgs arrive to the same/very similar results. Only for some data/initial parameter values they differ - for example when bfgs fails with nans due to that integer overflow problem. With basinhopping, L-BFGS-B is used as the local minimizer, see examples/psets/solvers.py. In practice, it seems that a very few iterations of basinhopping is needed, to avoid "pathological" starting values.

from dist_mixtures.

Related Issues (14)

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.