Learn R Programming

cylcop (version 0.2.0)

plot_cop_scat: Scatterplot of Copula Values

Description

This function produces a scatterplot ('ggplot' object) of a sample from a copula. Either a sample is provided as input, or a sample is drawn from a copula to quickly visualize it.

Usage

plot_cop_scat(traj = NULL, u = NULL, v = NULL)

Value

A 'ggplot' object, the scatterplot.

Arguments

traj

a data.frame containing the trajectory produced by e.g. traj_sim(), which must contain the columns traj$cop_u and traj$cop_v.

u

(alternatively) numeric vector of first components of pseudo-observations or draws from a copula.

v

(alternatively) numeric vector of second components of pseudo-observations or draws from a copula.

Details

Alternatively, instead of plotting a sample from a copula cop using scatterplot(copula=cop), you can also use plot(cop). If a trajectory is provided and n is smaller than nrow(traj), n steps are randomly selected from the trajectory and plotted.

References

Hodelapplcylcop

Hodelmethodcylcop

See Also

plot_track(), plot_joint_circ(), plot_cop_surf(), plot_joint_scat().

Examples

Run this code
set.seed(123)
traj <- traj_sim(100,
  copula = cyl_quadsec(0.1),
  marginal_circ = list(name = "vonmises", coef  = list(0, 1)),
  marginal_lin = list(name = "weibull", coef = list(shape = 3))
)
plot_cop_scat(traj = traj)

sample <- rcylcop(100,cyl_quadsec(0.1))
plot_cop_scat(u = sample[,1], v = sample[,2])

Run the code above in your browser using DataLab