Skip to content

Commit

Permalink
Add ExponentialTransiogram
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Nov 1, 2024
1 parent 3ddefdd commit 4575b11
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/GeoStatsFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,37 @@ export

# theoretical variograms
Variogram,
NuggetEffect,
GaussianVariogram,
SphericalVariogram,
ExponentialVariogram,
MaternVariogram,
SphericalVariogram,
CubicVariogram,
PentasphericalVariogram,
PowerVariogram,
SineHoleVariogram,
CircularVariogram,
PowerVariogram,
NuggetEffect,
NestedVariogram,
sill,
nugget,
structures,

# theoretical covariances
Covariance,
CircularCovariance,
CubicCovariance,
ExponentialCovariance,
GaussianCovariance,
SphericalCovariance,
ExponentialCovariance,
MaternCovariance,
CubicCovariance,
PentasphericalCovariance,
SineHoleCovariance,
SphericalCovariance,
CircularCovariance,

# theoretical transiograms
Transiogram,
LinearTransiogram,
SphericalTransiogram,
ExponentialTransiogram,
MatrixExponentialTransiogram,
PiecewiseLinearTransiogram,

Expand Down
1 change: 1 addition & 0 deletions src/theoretical/transiogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ isstationary(::Type{<:Transiogram}) = true

include("transiogram/linear.jl")
include("transiogram/spherical.jl")
include("transiogram/exponential.jl")
include("transiogram/matrixexponential.jl")
include("transiogram/piecewiselinear.jl")
32 changes: 32 additions & 0 deletions src/theoretical/transiogram/exponential.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

"""
ExponentialTransiogram(; ranges, proportions)
ExponentialTransiogram(ball; proportions)
A spherical transiogram with `ranges`, and `proportions`.
Optionally, use a custom metric `ball`.
"""
struct ExponentialTransiogram{P,B} <: Transiogram
prop::P
ball::B
end

ExponentialTransiogram(ball; proportions=(0.5, 0.5)) = ExponentialTransiogram(proportions, ball)

ExponentialTransiogram(; ranges=(1.0u"m", 1.0u"m"), proportions=(0.5, 0.5)) =
ExponentialTransiogram(proportions, MetricBall(ranges))

constructor(::ExponentialTransiogram) = ExponentialTransiogram

function (t::ExponentialTransiogram)(h)
r = radius(t.ball)
p = t.prop
L = length(p)
h′, r′ = unitless(h, r)
v = 1 - exp(-3(h′ / r′))
T = typeof(p[1] * v)
SMatrix{L,L}(i == j ? T(1 - (1 - p[j]) * v) : T((p[j] * v)) for i in 1:L, j in 1:L)
end
4 changes: 2 additions & 2 deletions src/theoretical/variogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ end
# ----------------

include("variogram/gaussian.jl")
include("variogram/exponential.jl")
include("variogram/spherical.jl")
include("variogram/exponential.jl")
include("variogram/matern.jl")
include("variogram/cubic.jl")
include("variogram/pentaspherical.jl")
include("variogram/sinehole.jl")
include("variogram/circular.jl")
include("variogram/power.jl")
include("variogram/nugget.jl")
include("variogram/circular.jl")
include("variogram/nested.jl")

0 comments on commit 4575b11

Please sign in to comment.