Git Product home page Git Product logo

Comments (3)

WillianFuks avatar WillianFuks commented on June 15, 2024 1

Hi @IvanUkhov ,

Once again thanks for the information about the SparseLinearRegression, it does indeed model the weights in a very similar way as spike-and-slab from R does (this is in fact mentioned in the docstring of the class).

As a side note (for future reference also for those seeing this issue), the original R package does make some assumptions on its SpikeAndSlab implementation, mainly, they've considered that the prior.df (first component of the gamma distribution for the standard deviation of the slab component) is 50, the expected R^2 is 0.8 and model size is set as 3. Internally, those values are manipulated accordingly to set the prior estimation for the sparsity of data and its variance.

For TFP, it uses instead a horseshoe distribution and only parameter we can manipulate is the weights_prior_scale which sets a prior for sparsity estimation as well (it's used when calculating the final values of the weights as a multiplicative term for local and global scales.)

Currently this value has been set as default (0.1). If someone finds a value that better models the assumptions from the original R package please feel free to either let us know or send a PR.

Still, probably final results wouldn't change much so it's more of a side feature nice to have :).

Let me know @IvanUkhov if the newer version of this package solves this issue for you.

Best,

Will

from tfcausalimpact.

WillianFuks avatar WillianFuks commented on June 15, 2024

Hi @IvanUkhov ,

Thanks for this reference :)! I'll research more about it and if the SparseLinearRegression is closer to spike-and-slab I'll replace it soon.

When developing this package I compared several examples from the original R results with TFP using LinearRegression and even though they differed a bit they tended to converge to similar values. After reading about the sparse version it does seem to be more appropriate (maybe it better models some sort of Lasso regression which affects the log-prob after all).

Thanks,

Will

from tfcausalimpact.

IvanUkhov avatar IvanUkhov commented on June 15, 2024

Thank you! I think it will be beneficial for the package in general. One of the selling points of the paper is that they take care of the variable selection via a prior inducing sparsity, which was not present here in any form until now.

from tfcausalimpact.

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.