Last data update: 2014.03.03

R: This function is the inverse of 'omega' function
omega_invR Documentation

This function is the inverse of omega function

Description

This function is the inverse of omega function

Usage

omega_inv(p0 = NULL, p0_v1 = 0.5, p0_v2 = p0_v1, p00 = p0_v1 * p0_v2,
  correlation = NA, only.value = TRUE, interval = c(-1, 1),
  tolerance = 0.001, nearPD = TRUE, force.independence = TRUE, ...)

Arguments

p0

matrix of joint probabilities. Default is NULL, otherwise functions returns a matrix with values

p0_v1,p0_v2

probablity of no precipitatin occurrences for the v1 and v2 time series respectively.

p00

probability of no precipitation occurence in both v1 and v2 simultanously returned by omega

only.value

logical value. If TRUE (Default) the only Gaussian correletion (x input variable of omega) is returned, otherwise the complete output of uniroot is returned.

correlation

numerical value. DEfault is NA. Binary correlation retured by omega when the argumet correlation=TRUE (see omega_root)

interval

see interval option of uniroot. Default is c(-1,1).

tolerance

tolerance (numeric) parameter used for comparisons with the extreme value of marginal probabilities. Default is 0.001.

nearPD

logical. If TRUE (Default) a positive-definite correlation matrix is returned by applying nearPD in case p0 is a matrix and not NULL.

force.independence

logical value. Default is TRUE. If it is TRUE, no negative corelation is considered and negative values of correletion are forced to be 0 (independence).

...

further arguments for uniroot

Value

value of expected correlation between the corresponding Gaussian-distributed variables (see x input argument of omega.

Note

This function finds the zero of the omega_root function by calling uniroot. If the argument p0 is not NULL and is a matrix of joint probabilities, the function returns a correlation matrix by using the elements of p0 ass joint probabilities for each couple and p0_v1 as a vector of marginal probability of each occurence/no-occurence (In this case if the length of p0_v1 does not correspond to the number of columns of p0, the marginal probabilities are taken from the diagonal of p0). See the R code for major details.

Author(s)

Emanuele Cordano

See Also

normalCopula,pcopula,omega(and reference URLs therein)

Examples

x <- omega_inv(p0_v1=0.5,p0_v2=0.5,p00=1.1*0.5*0.5)
omega(x,p0_v1=0.5,p0_v2=0.5)

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(RGENERATEPREC)
Loading required package: copula
Loading required package: RGENERATE
Loading required package: 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

Attaching package: 'vars'

The following object is masked from 'package:copula':

    A

Loading required package: blockmatrix
Loading required package: Matrix
Loading required package: stringr

Attaching package: 'stringr'

The following object is masked from 'package:strucchange':

    boundary

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RGENERATEPREC/omega_inv.Rd_%03d_medium.png", width=480, height=480)
> ### Name: omega_inv
> ### Title: This function is the inverse of 'omega' function
> ### Aliases: omega_inv
> 
> ### ** Examples
> 
> x <- omega_inv(p0_v1=0.5,p0_v2=0.5,p00=1.1*0.5*0.5)
> omega(x,p0_v1=0.5,p0_v2=0.5)
[1] 0.2749996
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>