istdx | R Documentation |
This function back transforms a standarized vector/matrix z
into their original values, i.e., re-scales all the values in the [0,1] interval to the original range of values z = re-scale(x) = x*[ xmax - xmin ] + xmin
.
istdx(x, ...)
## Default S3 method:
istdx(x, xmin, xrange, ...)
x |
standarized vector or matrix to be re-scaled, all the values have to be in the range [0,1] |
xmin |
numeric with the minimum value(s) in the original |
xrange |
numeric with the range of value(s) in the original |
... |
further arguments passed to or from other methods |
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
stdx
, scale
## Loading daily streamflows at the station Oca en Ona (Ebro River basin, Spain) ##
data(OcaEnOnaQts)
x <- OcaEnOnaQts
## Computing xmin and the range of 'x'
xmin <- min(x, na.rm=TRUE)
r <- diff(range(x, na.rm=TRUE))
## Standarized variable
s <- stdx(x)
## Inverse of the standarized variable
si <- istdx(s, xmin, xrange=r)
## 'si' and 'x' should be the same
summary(x-si)
###########
### Standarizing a subset of the stations 9 to 12 in 'EbroPPtsMonthly'
## Loading the monthly time series of precipitation within the Ebro River basin.
data(EbroPPtsMonthly)
pp <- EbroPPtsMonthly[1:70,10:13]
xmin <- apply(pp, 2, min, na.rm=TRUE)
xrange <- apply(pp, 2, range, na.rm=TRUE)
xrange <- apply(xrange, 2, diff, na.rm=TRUE)
## Standarized variable
s <- stdx(as.matrix(pp))
## Inverse of the standarized variable
si <- istdx(s, xmin, xrange)
## 'si' and 'pp' should be the same
summary(pp - si)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.