xySim: Generate simulations from bivariate dataset

Description Usage Arguments Value Examples

View source: R/xySim.R

Description

Generate simulations from bivariate datasets.

Usage

1
2
xySim(n = 100, xy, diffEC = forwardDifference(empiricalCDF2Dcounts(xy)),
  xcond = NULL)

Arguments

n

An integer specifying the number of simulations required.

xy

Numeric 2-columns table (data.frame, matrix, cbind) of real dataset. The first column is the independent variable while the second is the dependent variable.

diffEC

Forward difference with respect of $x$ of the empirical copula matrix. Maybe computed with forwardDifference of empiricalCDF2Dcounts. empiricalCDF2Dcounts.

xcond

A numeric vector being the 1st column of xy (xy[,1]). Must be conditional to the independent variable (x)? Default to NULL.

Value

A list with xy_sim: 2-columns matrix of simulated observations x,y. uv_sim: 2-columns matrix of simulated pseudo observations u,v.

Examples

1
2
3
4
# Example 1
data("PHIV_K"); plot(PHIV_K)
eSim <- xySim(n = 200, xy = PHIV_K)
plot(eSim$xy_sim)

mathphysmx/bernstein documentation built on Sept. 3, 2019, 12:57 p.m.