Giter Site home page Giter Site logo

Comments (4)

ArtPoon avatar ArtPoon commented on August 19, 2024
  • I would expect log-likelihood values to be negative.
  • The likelihood for a model a greater number of parameters should be tend to be higher, thus the log-likelihood should be a smaller negative value (closer to 0).

from clmp.

ArtPoon avatar ArtPoon commented on August 19, 2024

Using the examples/test.nwk tree, I get the following:

> clmp(t1)
log likelihood for 2 state model is 2238.543290
rates: 495.368077 1305.115690 
Q: [    *   2.526692 ]
   [ 23.309447   *    ]
> res0 <- clmp(t1, nrates=1)
log likelihood for 1 state model is 2227.311795
rates: 531.823491 
Q: [    *    ]

from clmp.

ArtPoon avatar ArtPoon commented on August 19, 2024

Log-likelihood calculation is being rescaled in mmpp.c:likelihood():

        new_scale = get_scale(&w->L[i * nrates], nrates);
        for (pstate = 0; pstate < nrates; ++pstate) {
            w->L[i * nrates + pstate] /= pow(10, new_scale);
        }
        w->scale[i] += new_scale;
    }
    // from utils.c
    lik = (reconstruct ? max_doubles : sum_doubles)(&w->L[rt * nrates], nrates);
    return log10(lik) + w->scale[rt];

Modify to return scaling constant?

from clmp.

ArtPoon avatar ArtPoon commented on August 19, 2024

It looks like scaling constant is always set to 0 if nrates=1, so I'm not sure the above is a satisfactory answer...

from clmp.

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.