Giter VIP home page Giter VIP logo

conjugate_prior's People

Contributors

urigoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

conjugate_prior's Issues

Normalnormal model issues

Hi, thanks for a useful package. I think there are a couple of bugs in the normalnormal model.

I think this line should be deleted.

https://github.com/urigoren/conjugate_prior/blob/b1589cdcd98b0512ae6b654c2f949305dbedc2de/conjugate_prior/normal.py#L22

I think these should calculate density functions as the sample and predict methods
https://github.com/urigoren/conjugate_prior/blob/b1589cdcd98b0512ae6b654c2f949305dbedc2de/conjugate_prior/normal.py#L30-L34

That is, something like

    def pdf(self, x):
        return stats.norm.pdf(x, self.mean, np.sqrt(self.var + self.known_var))

    def cdf(self, x):
        return stats.norm.cdf(x, self.mean, np.sqrt(self.var + self.known_var))

also, square roots have to be applied in all the stats.norm methods, as the input parameter in there is the standard deviation, not the variance.

Why using 1/x in pdf and cdf of Gamma class

In the GammaExponential class, why do you take 1/x for pdf and cdf methods?

    def pdf(self, x):
        return stats.gamma.pdf(1.0/x, self.alpha, scale=1.0/self.beta)
    def cdf(self, x):
        return 1-stats.gamma.cdf(1.0/x, self.alpha, scale=1.0/self.beta)

It looks like you are using the standard Gamma PDF definition with alpha and beta. This is exactly equal to the Gamma pdf in scipy if you set scale=1/Beta, as you do above. So it seems wrong to take the reciprocal of x for pdf and cdf calculation (and also to define cdf as 1-gamma.cdf).

Installation error

Hi,

I'm trying to install conjugate-prior using the command 'pip3 install conjugate-prior'

But it resulted in an error
Using cached conjugate_prior-0.38.tar.gz (4.0 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lauso1xv/conjugate-prior/setup.py'"'"'; file='"'"'/tmp/pip-install-lauso1xv/conjugate-prior/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-foq_3pxz
cwd: /tmp/pip-install-lauso1xv/conjugate-prior/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-lauso1xv/conjugate-prior/setup.py", line 3, in
with open(file.replace("setup.py", "README.md"), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-lauso1xv/conjugate-prior/README.md'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

my pip and supported files are upgraded and is up-to-date.
Its showing setup.py file is missing.
Please help to resolve this issue

Thanks in advance

Vidya
9446482122

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.