Skip to content
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

Feature request: Implement periodic covariance function #660

Closed
olspert opened this issue Oct 26, 2017 · 8 comments
Closed

Feature request: Implement periodic covariance function #660

olspert opened this issue Oct 26, 2017 · 8 comments
Milestone

Comments

@olspert
Copy link

olspert commented Oct 26, 2017

Summary:

Implement a periodic covariance function.
Periodic covariance function is defined as:
k(x, x')=sigma^2*exp(-2*sin(pi*|x-x'|/p)^2/l^2)),

where sigma^2 is the signal variance,p is the period and l is the lengthscale.

Description:

Create a new header file stan/math/prim/mat/fun/cov_per.hpp containing two functions named cov_per. Use code from stan/math/prim/mat/fun/cov_exp_quad.hpp as a template.

Create a new header file stan/math/rev/mat/fun/cov_per.hpp containing class named cov_per_vari and two functions named cov_per. Use code from stan/math/rev/mat/fun/cov_exp_quad.hpp as a template.

Write unit tests.

Current Version:

v2.17.0

@betanalpha
Copy link
Contributor

betanalpha commented Oct 26, 2017 via email

@bob-carpenter
Copy link
Contributor

Is that meant to be a minimal set of requirements for a pull request? Is cov_exp_quad not useful because it's incomplete?

@olspert
Copy link
Author

olspert commented Oct 27, 2017

Maybe this issue should be put on hold for a while until one example of a covariance function meeting the given requirements has been written by somebody. Periodic covariance function probably wouldn't be the best candidate for this task. I have though implemented all the functionality on the same level as it was for cov_exp_quad, but I guess there is no need to check this implementation in to the repository at this moment.

@betanalpha
Copy link
Contributor

betanalpha commented Oct 27, 2017 via email

@bob-carpenter
Copy link
Contributor

Is this the issue for fixing our existing not-up-to-spec covariance function?

#501

If so, it seems sensible to me to fix that first so we have at least one example to show people.

Personally, I'd rather get partial features in if they're useful and then backfill when necessary. It doesn't seem the full implementation for covariance functions is necessary for some of the functions to be useful.

My main worry is that he higher the hurdles are for submission, the fewer volunteer developers we'll be able to attract.

@olspert
Copy link
Author

olspert commented Nov 8, 2017

As I've been informed by Aki, it is ok if I make the pull request for the current issue without including yet the gp_name_chol and gp_name_lpdf to the implementation.
But later I guess together with issue #501 the corresponding functions for periodic covariance functions should be also added.

@bob-carpenter
Copy link
Contributor

@betanalpha and @syclik: Are you OK with @olspert's plan:

#660 (comment)

@syclik
Copy link
Member

syclik commented Nov 14, 2017

I'm ok with the plan! Thanks!

On a side note, perhaps we should change the language of the wiki: I think "must" should be replaced with "should." It's written in a style of a requirements document, but they weren't requirements before implementing cov_exp_quad and we don't actually know the effort level required to finish out what's listed there. (I implemented most of the cov_exp_quad functions the first time around and it was already a ton of effort to implement that much -- so much that it really took @rtrangucci's help to finish; maybe the other signatures would actually not take that much time, but not sure.)

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

No branches or pull requests

5 participants