Learn R Programming

qad (version 0.2.0)

plot.qad: Plot conditional probabilites

Description

Plots conditional probabilities for each strip of the checkerboard copula in the copula setting or in the retransformed data setting.

Usage

# S3 method for qad
plot(
  x,
  addSample = FALSE,
  copula = FALSE,
  density = FALSE,
  margins = FALSE,
  point.size = 0.8,
  panel.grid = TRUE,
  color = "plasma",
  rb_values = c(10, 0.315, 0.15),
  ...
)

Arguments

x

an object of class qad.

addSample

a logical determining whether the observations (or pseudo-observations) are added in the plot (default = FALSE).

copula

a logical indicating whether the plot depicts the conditional probabilities of the empirical checkerboard copula or of the retransformed data setting (default = FALSE).

density

a logical indicating whether the density should be plotted instead of the conditional probabilites (default = FALSE). Only works in the copula setting, i.e. if copula = TRUE.

margins

a logical indicating whether the margin distribution is added in form of a rug plot.

point.size

a numeric specifying the point size of the sample (relevant if addSample = TRUE).

panel.grid

a logical indicating whether the panel grid is plotted. (default = TRUE)

color

a color palette of the viridis package or rainbow. options are c("viridis", "magma", "inferno", "plasma", "cividis", "rainbow")

rb_values

a vector of size 3 with number of values, start value and end value in the rainbow colors space.

...

some methods for this generic require additional arguments. None are used in this method.

Examples

Run this code
# NOT RUN {
## Example 1
n <- 1000
x <- runif(n, 0, 1)
y <- runif(n, 0, 1)
sample <- data.frame(x, y)

#qad (Not Run)
# mod <- qad(sample)
# plot(mod, addSample = TRUE, copula = FALSE)

## Example 2
n <- 1000
x <- runif(n, -1, 1)
y <- x^2 + rnorm(n, 0, 0.1)
sample <- data.frame(x, y)

#qad (Not Run)
# mod <- qad(sample)
# plot(mod, addSample = TRUE, copula = TRUE)
# plot(mod, addSample = TRUE, copula = FALSE)

# }

Run the code above in your browser using DataLab