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

CovModels: limit exponent shape parameters to 50 to prevent numerical errors #147

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions gstools/covmodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,14 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"alpha": [0.5, inf]}``
* ``{"alpha": [0.5, 50.0]}``

Returns
-------
:class:`dict`
Boundaries for optional arguments
"""
return {"alpha": [0.5, np.inf]}
return {"alpha": [0.5, 50.0]}

def cor(self, h):
"""Rational normalized correlation function."""
Expand Down Expand Up @@ -677,14 +677,14 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"nu": [(dim-1)/2, inf, "co"]}``
* ``{"nu": [(dim-1)/2, 50.0, "co"]}``

Returns
-------
:class:`dict`
Boundaries for optional arguments
"""
return {"nu": [(self.dim - 1) / 2, np.inf, "co"]}
return {"nu": [(self.dim - 1) / 2, 50.0, "co"]}

def cor(self, h):
"""Super-Spherical normalized correlation function."""
Expand Down Expand Up @@ -751,14 +751,14 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"nu": [dim/2 - 1, inf, "co"]}``
* ``{"nu": [dim/2 - 1, 50.0, "co"]}``

Returns
-------
:class:`dict`
Boundaries for optional arguments
"""
return {"nu": [self.dim / 2 - 1, np.inf, "co"]}
return {"nu": [self.dim / 2 - 1, 50.0, "co"]}

def check_opt_arg(self):
"""Check the optional arguments.
Expand Down
18 changes: 9 additions & 9 deletions gstools/covmodel/tpl_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class TPLGaussian(TPLCovModel):
Default: ``0.5``
len_low : :class:`float`, optional
The lower length scale truncation of the model.
Standard range: ``[0, 1000]``.
Standard range: ``[0, inf]``.
Default: ``0.0``
"""

Expand All @@ -167,7 +167,7 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"hurst": [0, 1, "oo"], "len_low": [0, 1000, "cc"]}``
* ``{"hurst": [0, 1, "oo"], "len_low": [0, inf, "cc"]}``

Returns
-------
Expand Down Expand Up @@ -275,7 +275,7 @@ class TPLExponential(TPLCovModel):
Default: ``0.5``
len_low : :class:`float`, optional
The lower length scale truncation of the model.
Standard range: ``[0, 1000]``.
Standard range: ``[0, inf]``.
Default: ``0.0``
"""

Expand All @@ -294,7 +294,7 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"hurst": [0, 1, "oo"], "len_low": [0, 1000, "cc"]}``
* ``{"hurst": [0, 1, "oo"], "len_low": [0, inf, "cc"]}``

Returns
-------
Expand Down Expand Up @@ -413,7 +413,7 @@ class TPLStable(TPLCovModel):
Default: ``1.5``
len_low : :class:`float`, optional
The lower length scale truncation of the model.
Standard range: ``[0, 1000]``.
Standard range: ``[0, inf]``.
Default: ``0.0``
"""

Expand All @@ -434,7 +434,7 @@ def default_opt_arg_bounds(self):

* ``{"hurst": [0, 1, "oo"],
"alpha": [0, 2, "oc"],
"len_low": [0, 1000, "cc"]}``
"len_low": [0, inf, "cc"]}``

Returns
-------
Expand All @@ -459,7 +459,7 @@ def check_opt_arg(self):
if self.alpha < 0.3:
warnings.warn(
"TPLStable: parameter 'alpha' is < 0.3, "
+ "count with unstable results",
"count with unstable results",
AttributeWarning,
)

Expand Down Expand Up @@ -537,14 +537,14 @@ def default_opt_arg(self):
def default_opt_arg_bounds(self):
"""Defaults for boundaries of the optional arguments.

* ``{"nu": [dim/2 - 1, inf, "co"]}``
* ``{"nu": [dim/2 - 1, 50.0, "co"]}``

Returns
-------
:class:`dict`
Boundaries for optional arguments
"""
return {"nu": [(self.dim + 1) / 2, np.inf, "co"]}
return {"nu": [(self.dim + 1) / 2, 50.0, "co"]}

def cor(self, h):
"""TPL Simple - normalized correlation function."""
Expand Down