Skip to content

How to set a trend in field mean and field variance? #135

Answered by LSchueler
LSchueler asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @pbassal,
thanks for using GSTools! We are working hard on the 1.3 release at the moment, and there we plan to include the option to add a trend to the field (variable functional mean of the field).

But for now you can apply this by hand:

import numpy as np
import gstools as gs
import matplotlib.pyplot as plt


def mean(x, y):
    """Mean increases in x-direction."""
    return 0.5 * x


def var(x, y):
    """Variance increases in y-direction."""
    return 1 + 0.2 * y


x = y = range(51)
# generate an unstructured grid from x-y axes for calling above functions
xx, yy = np.meshgrid(x, y, indexing="ij")

# use mean of 0 and variance of 1 to get a standard field
model = gs.Exponential(dim=

Replies: 2 comments

Comment options

LSchueler
Jan 18, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by LSchueler
Comment options

LSchueler
Jan 18, 2021
Maintainer Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant