Giter Site home page Giter Site logo

Comments (4)

zijianni avatar zijianni commented on June 11, 2024

Hi @Peevin , there is no standard way to define the appropriate maxit value for different samples.

The convergence is defined numerically by the other argument tol. Even with the same tol value, the convergence speed is also dependent on the properties of input expression matrix (e.g. for one matrix you might reach numerical convergence within 20 iterations, but for another one you might need 50 iterations).

In practice you can keep using the same default value across your samples - it's the first few iterations that make the most significant changes to the gene expression. When the number of iterations grows bigger, the changes will become smaller, as you can see from the changes in likelihood value and max difference.

Let me know if that explains it or if you have additional questions.

from spotclean.

Peevin avatar Peevin commented on June 11, 2024

Hi @Peevin , there is no standard way to define the appropriate maxit value for different samples.

The convergence is defined numerically by the other argument tol. Even with the same tol value, the convergence speed is also dependent on the properties of input expression matrix (e.g. for one matrix you might reach numerical convergence within 20 iterations, but for another one you might need 50 iterations).

In practice you can keep using the same default value across your samples - it's the first few iterations that make the most significant changes to the gene expression. When the number of iterations grows bigger, the changes will become smaller, as you can see from the changes in likelihood value and max difference.

Let me know if that explains it or if you have additional questions.

Thanks very much for your reply.

Based on your response, I checked the output of spotclean in the RStudio console. As you mentioned, with increasing iterations, the change in max difference starts to become very small. In my previous runs, when it reached around 30 iterations, the change in max difference was already very small. Does this mean it has converged, or should I increase the number of iterations to ensure it stops when the max difference is below 1? Another question is, if I increase the number of iterations excessively to ensure it stops when the max difference is below 1, would it result in excessive data correction?

from spotclean.

zijianni avatar zijianni commented on June 11, 2024

Again, the definition of convergence is numerical and depends on tol. If you increase tol you could have a numerical convergence within 30 iterations.

For your second question, No - What the algorithm does is to find the parameter value that maximizes the likelihood (locally, to be rigorous). The iteration process is to move the current estimation closer and closer to the maximizer, but won't move beyond it.

In practice, 30 iterations should be sufficient, as any future iterations are making smaller and smaller changes to the estimation, but they still take the same amount of time to compute, which is not fast, to be honest.

from spotclean.

Peevin avatar Peevin commented on June 11, 2024

@zijianni Thank you very much! After careful consideration, we have made the decision to set a bigger maxit parameter and utilize the default tol setting for running spotclean. This will help us obtain "cleaner" spatial transcriptome data, which is crucial for our downstream analysis.

from spotclean.

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.