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
Comments
Please see https://github.com/stan-dev/stan/wiki/Adding-a-Gaussian-Process-Covariance-Function <https://github.com/stan-dev/stan/wiki/Adding-a-Gaussian-Process-Covariance-Function>
for what we are requesting for the addition of new covariance functions. cov_exp_quad was a
prototypical implementation and hence is still technically incomplete.
… On Oct 26, 2017, at 10:09 AM, olspert ***@***.***> wrote:
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#660>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABdNlhk30kOeA5XhJYr56QT_iDZPL7SGks5swJKtgaJpZM4QHott>.
|
Is that meant to be a minimal set of requirements for a pull request? Is |
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. |
Yes, minimal. The lpdf and Cholesky don’t have to be well implemented — for
example the latter can just be a lightweight function that calls the covariance
matrix function and then returns its Cholesky. If the covariance matrix is
structured then these implementations can be much more sophisticated to
take advantage of that structure, but they don’t have to especially on the first
iteration of implementation.
Right now using even cov_exp_quad is a bit ungainly because you have to
repeat the steps of creating the matrix and then plugging it into a multivariate
normal (for the centered parameterization) or taking its Cholesky (for the
non-centered parameterization). Having all three functions makes it much
more streamlined to implement the corresponding GP and requiring that
all covariance functions support all three functions makes it uniform.
Again, adding the two additional functions is very straightforward once the
covariance matrix has been implemented.
… On Oct 26, 2017, at 10:23 PM, Bob Carpenter ***@***.***> wrote:
Is that meant to be a minimal set of requirements for a pull request? Is cov_exp_quad not useful because it's incomplete?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#660 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABdNlranHAPRZQxIjAHTolGBanWBzsTqks5swT6ggaJpZM4QHott>.
|
Is this the issue for fixing our existing not-up-to-spec covariance function? 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. |
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. |
@betanalpha and @syclik: Are you OK with @olspert's plan: |
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 |
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
The text was updated successfully, but these errors were encountered: