vfploto: Plotting the cumulative distribution function or survival...

Description Usage Arguments Details Value Author(s) Examples

View source: R/vfploto.R

Description

Plotting the cumulative distribution function or survival function.

Usage

1
2
vfploto(cx, pro, fam, marg, xo, tht, cdf=TRUE, plt=TRUE, rtn=FALSE,
  ped = TRUE)

Arguments

cx

A vector of copula probabilities.

pro

Numeric vector. Its pro[1] is upper value of the u. Next pro[-1] are then all greater than or equal to 1. The second case of pro is all pro less than 1. The first case is an extra calculation of the u values. In the latter case, u values can be pre-selected.

fam

character; A name of copula. One of c("clayton", "frank", "gumbel", "amh", "joe", "fgm"). "amh", "joe", "fgm" names are for Ali-Mikhail-Haq, Joe, Farlie-Gumbel-Morgenstern copulas.

marg

A vector size 2. Combination of these marginals:
c("weibull", "gamma", "lnorm", "norm", "betapr", "beta").

xo

A vector of marginal distribution parameters. It is size 4 with these components:

xo[1], xo[3] scale, meanlog, mean, shape1
xo[2], xo[4] shape, sdlog, sd, shape2
tht

copula parameter

cdf

logical; Computation for CDF when TRUE. If FALSE is the same for Survival.

plt

Plot only when TRUE.

rtn

Print output value only when TRUE.

ped

Compute and add to plot an expected values o f marginal distributions when ped = TRUE.

Details

Must not be plt and rtn at the same time equal to FALSE.

Value

If rtn is TRUE, then a list of these components:

Type character; "CDF" or "Survival"
P numeric; CDF or Survival value
x numeric vector of the first marginal values for P
y numeric vector of the second marginal values for P
u numeric vector of the first copula marginal values
v numeric vector of the second copula marginal values

Author(s)

Josef Brejcha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require(copula)
tht = 0.475
cx = c(0.0025, 0.05, seq(0.1, 0.9, 0.1), 0.95, 0.975)
# nC = length(cx)
proh = c(0.9999999, 8, 4, 4, 4)
prod = c(0.999, 8, 4, 4, 4)
fam = "clayton"
marg = c("weibull", "lnorm")
xo = c(100, 1.5, 3, 0.425)
suro = vfploto(cx, proh, fam, marg, xo, tht, cdf=FALSE, plt=TRUE, rtn=FALSE)
cdfo = vfploto(cx, prod, fam, marg, xo, tht, cdf=TRUE, plt=TRUE, rtn=FALSE)
##
cx = 0.4
vfploto(cx, proh, fam, marg, xo, tht, cdf=TRUE, plt=FALSE, rtn=TRUE,
        ped = TRUE)

vfcp documentation built on May 2, 2019, 2:52 p.m.