Skip to content

Commit

Permalink
Update with latest modules
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Sep 20, 2023
1 parent 0964392 commit 00049f1
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 109 deletions.
16 changes: 8 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DensityRatioEstimation = "ab46fb84-d57c-11e9-2f65-6f72e4a7229f"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
GeoClustering = "7472b188-6dde-460e-bd07-96c4bc049f7e"
GeoStatsBase = "323cb8eb-fbf6-51c0-afd0-f8fba70507b2"
GeoStatsModels = "ad987403-13c5-47b5-afee-0a48f6ac4f12"
GeoStatsSolvers = "50e95529-e670-4fa6-84ad-e28f686cc091"
GeoStatsTransforms = "725d9659-360f-4996-9c94-5f19c7e4a8a6"
GeoTables = "e502b557-6362-48c1-8219-d30d308dcdb0"
KrigingEstimators = "d293930c-a38c-56c5-8ebb-12008647b47a"
LossFunctions = "30fc2ffe-d236-52d8-8643-a9d8f7c094a7"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
PointPatterns = "e61b41b6-3414-4803-863f-2b69057479eb"
Expand All @@ -37,11 +37,11 @@ CategoricalArrays = "0.10"
Chain = "0.5"
DensityRatioEstimation = "1.0"
Distances = "0.10"
GeoClustering = "0.5"
GeoStatsBase = "0.35"
GeoStatsSolvers = "0.6"
GeoTables = "1.6"
KrigingEstimators = "0.12"
GeoStatsBase = "0.36"
GeoStatsModels = "0.1"
GeoStatsSolvers = "0.7"
GeoStatsTransforms = "0.1"
GeoTables = "1.7"
LossFunctions = "0.11"
Makie = "0.19"
Meshes = "0.35"
Expand All @@ -52,5 +52,5 @@ ScientificTypes = "3.0"
TableTransforms = "1.9"
Tables = "1.10"
Unitful = "1.15"
Variography = "0.18"
Variography = "0.19"
julia = "1.9"
29 changes: 6 additions & 23 deletions docs/src/clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,16 @@ Consider the following data as an example:
viz(Ω.geometry, color = Ω.Z)
```

We can cluster the data with traditional clustering models from
[MLJ.jl](https://github.com/alan-turing-institute/MLJ.jl):

```@example clustering
using MLJ
kmeans = MLJ.@load KMeans pkg=Clustering
𝒞 = cluster(Ω, kmeans(k=50))
viz(𝒞.geometry, color = 𝒞.cluster)
```

but there is no guarantee that the clusters will consist of contiguous
volumes in space. Alternatively, we can use the following geostatistical
models:

## GHC

```@docs
GHC
```

```@example clustering
𝒞 = cluster(Ω, GHC(20, 1.0))
𝒞 = Ω |> GHC(20, 1.0)
viz(𝒞.geometry, color = 𝒞.cluster)
viz(𝒞.geometry, color = 𝒞.CLUSTER)
```

## GSC
Expand All @@ -56,9 +39,9 @@ GSC
```

```@example clustering
𝒞 = cluster(Ω, GSC(50, 2.0))
𝒞 = Ω |> GSC(50, 2.0)
viz(𝒞.geometry, color = 𝒞.cluster)
viz(𝒞.geometry, color = 𝒞.CLUSTER)
```

## SLIC
Expand All @@ -68,7 +51,7 @@ SLIC
```

```@example clustering
𝒞 = cluster(Ω, SLIC(50, 0.01))
𝒞 = Ω |> SLIC(50, 0.01)
viz(𝒞.geometry, color = 𝒞.cluster)
viz(𝒞.geometry, color = 𝒞.CLUSTER)
```
9 changes: 5 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ coord = [(25.,25.), (50.,75.), (75.,50.)]
𝒫 = EstimationProblem(𝒟, 𝒢, :Z)
# choose a solver from the list of solvers
𝒮 = Kriging(:Z => (variogram=GaussianVariogram(range=35.),))
𝒮 = KrigingSolver(:Z => (variogram=GaussianVariogram(range=35.),))
# solve the problem
Ω = solve(𝒫, 𝒮)
Expand Down Expand Up @@ -131,13 +131,14 @@ The project is split into various packages:
|:-------:|:------------|
| [GeoStats.jl](https://github.com/JuliaEarth/GeoStats.jl) | Main package reexporting full stack of packages for geostatistics. |
| [Meshes.jl](https://github.com/JuliaGeometry/Meshes.jl) | Computational geometry and advanced meshing algorithms. |
| [GeoTables.jl](https://github.com/JuliaEarth/GeoTables.jl) | Geospatial tables compatible with the framework. |
| [TableTransforms.jl](https://github.com/JuliaML/TableTransforms.jl) | Transforms and pipelines with tabular data. |
| [Variography.jl](https://github.com/JuliaEarth/Variography.jl) | Variogram estimation and modeling, and related tools. |
| [KrigingEstimators.jl](https://github.com/JuliaEarth/KrigingEstimators.jl) | Kriging estimation over general geospatial domains. |
| [PointPatterns.jl](https://github.com/JuliaEarth/PointPatterns.jl) | Geospatial point pattern analysis and synthesis. |
| [DensityRatioEstimation.jl](https://github.com/JuliaML/DensityRatioEstimation.jl) | High-performance density ratio estimation. |
| [LossFunctions.jl](https://github.com/JuliaML/LossFunctions.jl) | Loss functions for (geo)statistical learning. |
| [PointPatterns.jl](https://github.com/JuliaEarth/PointPatterns.jl) | Geospatial point pattern analysis and synthesis. |
| [GeoClustering.jl](https://github.com/JuliaEarth/GeoClustering.jl) | Geostatistical clustering (a.k.a. domaining). |
| [GeoStatsModels.jl](https://github.com/JuliaEarth/GeoStatsModels.jl) | Geostatistical models for geospatial interpolation. |
| [GeoStatsTransforms.jl](https://github.com/JuliaEarth/GeoStatsTransforms.jl) | Geostatistical transforms for geospatial data. |
| [GeoStatsSolvers.jl](https://github.com/JuliaEarth/GeoStatsSolvers.jl) | Built-in geostatistical solvers. |
| [GeoStatsBase.jl](https://github.com/JuliaEarth/GeoStatsBase.jl) | Base package with core definitions. |

Expand Down
53 changes: 11 additions & 42 deletions docs/src/kriging.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

!!! note

This section describes the estimators used in the [Kriging](solvers/builtin.md) solver.
Most users don't want to use estimators directly because they lack features such as
This section describes the models used in the [KrigingSolver](solvers/builtin.md).
Most users don't want to use models directly because they lack features such as
neighborhood search and change of support. If that is your case, please refer to the
solver documentation.

Expand All @@ -22,45 +22,14 @@ This package implements the following Kriging variants:
- Universal Kriging
- External Drift Kriging

All these variants follow the same interface: an estimator object is first created with a
given set of parameters, it is then combined with the data to obtain predictions at new
locations.
All these variants follow the same interface: an object is first created with a given set
of parameters, it is then combined with the data to obtain predictions at new geometries.

The `fit` function takes care of building the Kriging system and factorizing the LHS with
an appropriate decomposition (e.g. Cholesky, LU):
an appropriate decomposition (e.g. Cholesky, LU), and the `predict` (or `predictprob`)
function performs the estimation for a given variable and geometry.

```@docs
fit(::KrigingEstimator, ::Any)
```

and the `predict` function performs the estimation for a given variable and location:

```@docs
predict(::KrigingEstimators.FittedKriging, ::Any, ::Any)
predictprob(::KrigingEstimators.FittedKriging, ::Any, ::Any)
```

Alternative constructors are provided for convenience that will immediately fit the Kriging
parameters to the data. In this case, the data is passed as the first argument.

For advanced users, the Kriging weights and Lagrange multipliers at a given location can be accessed
with the `weights` method. This method returns a `KrigingWeights` object containing a field `λ` for
the weights and a field `ν` for the Lagrange multipliers:

```@docs
weights
```

These weights can be combined with a vector of observations using the `combine` function:

```@docs
KrigingEstimators.combine
```

This functionality can be useful in real-time applications when the locations of the observations are
fixed and an online stream of data is available.

Finally, all estimators work with general Hilbert spaces, meaning that one can interpolate any
All variants work with general Hilbert spaces, meaning that one can interpolate any
data type that implements scalar multiplication, vector addition and inner product.

## Simple Kriging
Expand Down Expand Up @@ -100,7 +69,7 @@ or in matricial form ``\C\l = \c``. We subtract the given mean from the observat
```

```@docs
SimpleKriging
GeoStatsModels.SimpleKriging
```

## Ordinary Kriging
Expand Down Expand Up @@ -134,7 +103,7 @@ location ``\x_0`` are given by:
```

```@docs
OrdinaryKriging
GeoStatsModels.OrdinaryKriging
```

## Universal Kriging
Expand Down Expand Up @@ -206,7 +175,7 @@ variance at location ``\x_0`` are given by:
```

```@docs
UniversalKriging
GeoStatsModels.UniversalKriging
```

## External Drift Kriging
Expand All @@ -224,5 +193,5 @@ estimated.
External drifts are known to cause numerical instability. Give preference to other Kriging variants if possible.

```@docs
ExternalDriftKriging
GeoStatsModels.ExternalDriftKriging
```
21 changes: 0 additions & 21 deletions docs/src/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,6 @@ using GeoStatsImages
Π = geosplit(𝒟, 0.5, (1.0, 1.0))
```

## Trend

```@docs
trend
```

```@example misc
# quadratic + noise
r = range(-1,stop=1,length=100)
μ = [x^2 + y^2 for x in r, y in r]
ϵ = 0.1rand(100,100)
𝒟 = georef((Z=μ+ϵ,))
ℳ = trend(𝒟, :Z, degree=2)
fig = Mke.Figure(resolution = (800, 400))
viz(fig[1,1], 𝒟.geometry, color = 𝒟.Z)
viz(fig[1,2], ℳ.geometry, color = ℳ.Z)
fig
```

## Integrate

```@docs
Expand Down
4 changes: 2 additions & 2 deletions docs/src/problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ coord = [(25.,25.), (50.,75.), (75.,50.)]
𝒫 = EstimationProblem(𝒟, 𝒢, :Z)
```

Solve the problem with [`Kriging`](@ref) solver:
Solve the problem with the [`KrigingSolver`](@ref):

```@example problems
# ordinary Kriging
𝒮 = Kriging(:Z => (variogram=GaussianVariogram(range=35.),))
𝒮 = KrigingSolver(:Z => (variogram=GaussianVariogram(range=35.),))
# perform estimation
Ω = solve(𝒫, 𝒮)
Expand Down
6 changes: 3 additions & 3 deletions docs/src/solvers/builtin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Below is the list of solvers that are readily available after loading the projec
## Estimation

```@docs
Kriging
IDW
LWR
KrigingSolver
IDWSolver
LWRSolver
```

## Simulation
Expand Down
6 changes: 3 additions & 3 deletions docs/src/solvers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Please consult

| Solver | Description | References |
|:------:|:------------|:-----------|
| [`Kriging`](@ref) | Kriging (SK, OK, UK, EDK) | [Matheron 1971](https://books.google.com/books/about/The_Theory_of_Regionalized_Variables_and.html?id=TGhGAAAAYAAJ) |
| [`IDW`](@ref) | Inverse distance weighting | [Shepard 1968](https://dl.acm.org/citation.cfm?id=810616) |
| [`LWR`](@ref) | Locally weighted regression | [Cleveland 1979](https://www.jstor.org/stable/2286407) |
| [`KrigingSolver`](@ref) | Kriging (SK, OK, UK, EDK) | [Matheron 1971](https://books.google.com/books/about/The_Theory_of_Regionalized_Variables_and.html?id=TGhGAAAAYAAJ) |
| [`IDWSolver`](@ref) | Inverse distance weighting | [Shepard 1968](https://dl.acm.org/citation.cfm?id=810616) |
| [`LWRSolver`](@ref) | Locally weighted regression | [Cleveland 1979](https://www.jstor.org/stable/2286407) |

## Simulation

Expand Down
2 changes: 1 addition & 1 deletion docs/src/variography/theoretical.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ for (i, θ) in enumerate(θs)
γ = GaussianVariogram(e)
# solve the problem with Kriging
sol = solve(problem, Kriging(:Z => (variogram=γ,)))
sol = solve(problem, KrigingSolver(:Z => (variogram=γ,)))
# visualize solution at subplot i
viz(fig[pos(i)...], sol.geometry, color = sol.Z,
Expand Down
4 changes: 2 additions & 2 deletions src/GeoStats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ using Reexport
@reexport using TableTransforms
@reexport using GeoStatsBase
@reexport using Variography
@reexport using KrigingEstimators
@reexport using PointPatterns
@reexport using GeoClustering
@reexport using GeoStatsModels
@reexport using GeoStatsTransforms
@reexport using GeoStatsSolvers
@reexport using Chain: @chain

Expand Down

0 comments on commit 00049f1

Please sign in to comment.