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

add Covariance methods #4

Merged
merged 6 commits into from
Mar 25, 2024
Merged

Conversation

markmbaum
Copy link
Contributor

I added methods for Covariance types that weren't initially implemented:

  • isstationary
  • isisotropic
  • sill
  • nugget
  • metricball
  • Base.range
  • scale

All of these methods pass the call to the underlying variogram, so I didn't add any new tests.

I did confirm that the example in the linked issue now works:

field = rand(
    GaussianCovariance() |> GaussianProcess,
    CartesianGrid(10, 10),
    :x => Float64,
)

closes JuliaEarth/GeoStats.jl#404

src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
Copy link
Member

@juliohm juliohm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the issue. Besides the small changes regarding internal fields, we also need basic tests for coverage purposes.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@markmbaum
Copy link
Contributor Author

Is there a public API for the γ field? I considered this but noticed

(cov::Covariance)(x₁, x₂) = sill(cov.γ) - cov.γ(x₁, x₂)

and followed along.

I could add a variogram(cov::Covariance) = cov.γ function.

@juliohm
Copy link
Member

juliohm commented Mar 25, 2024 via email

src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
Copy link
Member

@juliohm juliohm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @markmbaum , attached a last round of review for this one.

markmbaum and others added 2 commits March 25, 2024 06:53
Co-authored-by: Júlio Hoffimann <julio.hoffimann@gmail.com>
@markmbaum
Copy link
Contributor Author

I think it should be all set now. All tests passed locally.

src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
src/covariance.jl Outdated Show resolved Hide resolved
@juliohm juliohm merged commit 0ac7c03 into JuliaEarth:main Mar 25, 2024
6 checks passed
@juliohm
Copy link
Member

juliohm commented Mar 25, 2024

Thank you @markmbaum ! Releasing a patch for this now...

@markmbaum markmbaum deleted the covariance-methods branch March 25, 2024 14:25
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.

Gaussian Processes with Variogram vs Covariance
3 participants