structurogram: Structure Function for Non-Gridded Spatial Fields.

View source: R/Vgrams.R

structurogramR Documentation

Structure Function for Non-Gridded Spatial Fields.

Description

Computes pairwise differences (raised to the q-th power) as a function of distance. Returns either raw values or statistics from binning.

Usage

structurogram(loc, y, q = 2, id = NULL, d = NULL, lon.lat = FALSE, dmax = NULL,
    N = NULL, breaks = NULL)

## S3 method for class 'structurogram'
plot(x, ...)

Arguments

loc

numeric matrix where each row is the coordinate of a point in the field.

x

list object returned by structurogram function.

y

numeric vector giving the value of the field at each location.

q

numeric giving the value to which the paired differences should be raised. Default (q=2) gives the usual semivariogram.

id

A 2 column matrix that specifies which variogram differnces to find. If omitted all possible pairings are found. This can used if the data has an additional covariate that determines proximity, for example a time window.

d

numeric matrix giving the distances among pairs (indexed by id). If not included, these are determined directly from loc.

lon.lat

logical, are the coordinates longitude/latitude coordinates? If so, distances are found using great-circle distance.

dmax

numeric giving the maximum distance for which to compute the structure function.

N

numeric giving the number of bins to use.

breaks

numeric vector giving bin boundaries for binning structure function values. Need not be equally spaced, but must be ordered.

...

optional arguments to plot function.

Details

This function is basically an exact copy of vgram from package fields whereby the differences are raised to a power of q instead of 2. That is, it calculates the structure function given by Eq (4) in harris et al. (2001). Namely,

S_q(l_x,l_y) = <|R(x+l_x,y+l_y) - R(x,y)|^q>

where R is the field of interest, <> denotes the average over pixels in the image (note, in Harris et al. (2001), this is only over non-zero pixels, so is only equivalent to this equation if zero-valued points are first removed from y and loc), l_x and l_y are lags in the x and y directions, resp. If q=2, then this is the semivariogram.

The plot method function plots the structure by separation distance (circles) along with a dark blue line giving the bin centers.

Value

A list object of class “structurogram” is returned with components:

d

numeric vector giving the pair-wise distances.

val

numeric vector giving the structure function values for each distance.

q

numeric giving the value of q passed into the function.

call

Calling string

stats

Matrix of statistics for values in each bin. Rows are the summaries returned by the stats function or describe (see package fields). If either breaks or N arguments are not supplied then this component is not computed.

centers

numeric vector giving the bin centers.

The plot method function does not return anything.

Author(s)

Eric Gilleland

References

Harris, D., Foufoula-Georgiou, E., Droegemeier, K. K. and Levit, J. J. (2001) Multiscale statistical properties of a high-resolution precipitation forecast. J. Hydrometeorol., 2, 406–418.

See Also

vgram, vgram.matrix, structurogram.matrix

Examples

data( ozone2)
good<- !is.na(ozone2$y[16,])
x<- ozone2$lon.lat[good,] 
y<- ozone2$y[16,good]
     
look <- structurogram( x,y, N=15, lon.lat=TRUE)
plot(look)
# Compare above with results from example for function vgram from package fields.

look <- structurogram( x,y, N=15, lon.lat=TRUE, q=1)
plot(look)


SpatialVx documentation built on May 29, 2024, 9:31 a.m.