sadcorrect {sad} | R Documentation |
correct structure errors
Description
use the inverse 'dtcwt' to correct errors in scale, anisotropy and direction
Usage
sadcorrect(x, xmin = 0.1, log = TRUE, rsm = 0, Nx = NULL,
Ny = NULL, J = NULL, boundaries = "pad", direction = TRUE)
Arguments
x |
a list of equally sized matrices, the first element is assumed to be the observation |
xmin |
values smaller than |
log |
logical, do you want to log-transfrom the data? (recommended for precipitation) |
rsm |
number of pixels which are linearly smoothed at the edge |
Nx |
size to which the data is extended in x-direction, has to be a whole power of 2 |
Ny |
size to which the data is extended in y-direction, has to be a whole power of 2 |
J |
largest scale considered |
boundaries |
how to handle the boundary conditions, either "pad", "mirror" or "periodic" |
direction |
if |
Details
The algorithm performs the following steps:
remove values below
xmin
if
log=TRUE
log-transform all fieldsset all fields to zero mean, unit variance
apply
dtcwt
to all fieldsloop over forecasts and scales. If
direction=TRUE
loop over the six directions. Multiply forecast energy at each location by the ratio of total observed energy to total forecast energy at that scale (and possibly direction)apply
idtcwt
to all forecastsreset means and variance of the forecasts to their original values
if
log=TRUE
invert the log-transformreturn the list of corrected fields
Value
an object of class sadforecast
Examples
data(rrain)
ra <- as.sadforecast( list( rrain[2,1,,], rrain[3,1,,], rrain[3,2,,], rrain[3,3,,] ) )
ra_c <- sadcorrect( ra, rsm=10 )
plot(ra_c)