argmaxml / conjugate_prior Goto Github PK
View Code? Open in Web Editor NEWImplementation of the conjugate prior table for Bayesian Statistics
License: MIT License
Implementation of the conjugate prior table for Bayesian Statistics
License: MIT License
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.
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.
In nomal.py
line 68, the function raises something instead of returning it. Change raise
for return
.
Thanks
Line 38:
mean(self) should be returning self.alpha/ self.beta
Cool package, Thanks
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).
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.