Last data update: 2014.03.03

R: Converts precipitation values to "Gaussinized"...
normalizeGaussian_precR Documentation

Converts precipitation values to "Gaussinized" normally-distributed values taking into account the probability of no precipitation occurences. values or vice versa in case inverse is TRUE

Description

Converts precipitation values to "Gaussinized" normally-distributed values taking into account the probability of no precipitation occurences. values or vice versa in case inverse is TRUE

Usage

normalizeGaussian_prec(x = 0, data = x, cpf = NULL, mean = 0, sd = 1,
  inverse = FALSE, type = 3, extremes = TRUE, sample = NULL,
  qnull = 0, valmin = 1)

Arguments

x

value or vector of values to be converted

data

a sample of data on which a non-parametric probability distribution is estimated

cpf

cumulative probability distribution. If NULL (default) is calculated as ecdf(data)

mean

mean (expected value) of the normalized random variable. Default is 0.

sd

standard deviation of the normalized random variable. Default is 1.

inverse

logical value. If TRUE the function works inversely (the opposite way). Default is FALSE.

type

see quantile

extremes

logical variable. If TRUE (default) the probability or frequency is multiplied by

frac{N}{N+1}

where N is the length of data

sample

a character string or NULL containing sample or probability distribution information. Default is NULL

qnull

probability of no precipitation occurence

valmin

minimum value of precipitation to consider a wet day

Value

the normalized variable or its inverse

Note

In the version 1.2.5 of RMAWGEN This function is deprecated and not used.

Author(s)

Emanuele Cordano, Emanuele Eccel

See Also

normalizeGaussian

Examples

library(RMAWGEN)
NDATA <- 1000
occurence <- as.logical(runif(NDATA)>0.5)
prec <- rexp(NDATA,rate=1/3)
prec[!occurence] <- 0
valmin <- 0.5 #0.01
x <- normalizeGaussian_prec(x=prec,valmin=valmin)
prec2 <- normalizeGaussian_prec(x=x,data=prec,valmin=valmin,inverse=TRUE)
qqplot(prec,prec2)

occurence3 <- as.logical(runif(NDATA)>0.5)
prec3 <- rexp(NDATA,rate=1/3)
prec3[!occurence3] <- 0
x3 <- normalizeGaussian_prec(x=prec3,valmin=valmin)

qqplot(x,x3)
abline(0,1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RMAWGEN)
Loading required package: chron
Loading required package: date
Loading required package: vars
Loading required package: MASS
Loading required package: strucchange
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich
Loading required package: urca
Loading required package: lmtest
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RMAWGEN/normalizeGaussian_prec.Rd_%03d_medium.png", width=480, height=480)
> ### Name: normalizeGaussian_prec
> ### Title: Converts precipitation values to "Gaussinized"
> ###   normally-distributed values taking into account the probability of no
> ###   precipitation occurences. values or vice versa in case 'inverse' is
> ###   'TRUE'
> ### Aliases: normalizeGaussian_prec
> 
> ### ** Examples
> 
> library(RMAWGEN)
> NDATA <- 1000
> occurence <- as.logical(runif(NDATA)>0.5)
> prec <- rexp(NDATA,rate=1/3)
> prec[!occurence] <- 0
> valmin <- 0.5 #0.01
> x <- normalizeGaussian_prec(x=prec,valmin=valmin)
> prec2 <- normalizeGaussian_prec(x=x,data=prec,valmin=valmin,inverse=TRUE)
> qqplot(prec,prec2)
> 
> occurence3 <- as.logical(runif(NDATA)>0.5)
> prec3 <- rexp(NDATA,rate=1/3)
> prec3[!occurence3] <- 0
> x3 <- normalizeGaussian_prec(x=prec3,valmin=valmin)
> 
> qqplot(x,x3)
> abline(0,1)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>