Skip to content

Adding a function to distributions.py #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

wesm
Copy link
Contributor

@wesm wesm commented Oct 22, 2010

And testing out the git workflow.

There's a global git setting that trims trailing whitespace in files, tends to be good practice in general-- I have emacs do it automatically for me, but as you can see it creates diff cruft. Up to you...

@apatil
Copy link
Contributor

apatil commented Oct 22, 2010

Thanks for the function, Wes. Are you also planning on implementing inverse_wishart_cov_like and inverse_wishart_cov_expval?

We do actually have a script to remove trailing whitespace, just aren't as vigilant about using it as we should be.

Cheers,
Anand

@wesm
Copy link
Contributor Author

wesm commented Oct 22, 2010

Sure, I can do that for consistency's sake. I think you can set up a pre-commit hook to do it automatically on commits, there are various recipes floating around out there:

http://snipplr.com/view/28523/git-precommit-hook-to-fix-trailing-whitespace/

separately there's a git config flag that warn you if there's trailing whitespace.

I'm still learning the pymc codebase but I will periodically make contributions over the next few years probably, so bear with me :)

@apatil
Copy link
Contributor

apatil commented Oct 22, 2010

Great, thanks! I think we'll wait for the full set of functions before pulling. Thanks also for the precommit hook, will have a look. Good luck and let us know on the ML if anything is confusing.

Anand

@wesm
Copy link
Contributor Author

wesm commented Oct 22, 2010

Got it, I'll do that soon and get back to you.

Do you guys have a general testing policy for the distribution functions?

@apatil
Copy link
Contributor

apatil commented Oct 22, 2010

Yes, but I didn't want to stretch the friendship. See

http://github.com/pymc-devs/pymc/blob/master/pymc/tests/test_distributions.py#L968

and also

http://github.com/pymc-devs/pymc/blob/master/pymc/distributions.py#L65

needs to be modified to fully integrate it.

@wesm
Copy link
Contributor Author

wesm commented Oct 22, 2010

No problem at all. As a quid pro quo you might catch me reformatting code to fit in inside the 80 character margin, hope you don't mind terribly =)

@wesm
Copy link
Contributor Author

wesm commented Oct 23, 2010

Anand-- on reviewing the code again, I realized that I had things backwards-- what I was looking for was an rinverse_wishart function parameterized using the precision matrix instead of the scale/covariance matrix. I got confused because the function signature is rinverse_wishart(n, Tau), and Tau means precision elsewhere (like in rwishart).

I can tweak the naming convention and docs to make it clear what the distinction is.

So there are some issues:

  • the commit I made a pull request with earlier today is incorrect, I'll fix it in my branch. If you're OK having that revision in there then there's no problem
  • do you have a preference for what to call this other form of the distribution?
  • I noticed that rwishart / rwishart_cov give different answers for the same random seed-- I wrote a unit test to compare the output, I changed rwishart_cov to call rwishart for the time being (this will all be in a separate commit), not sure how you'd like to address this

Armavica pushed a commit to Armavica/pymc that referenced this pull request Nov 29, 2022
@maresb maresb mentioned this pull request Apr 6, 2024
11 tasks
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants