| joint {cylcop} | R Documentation |
Density, Distribution, Quantiles and Random Number Generation for joint distributions
Description
The bivariate joint distributions are described in terms of two marginal distributions and a copula
Usage
rjoint(n, copula, marginal_1, marginal_2)
djoint(x, copula, marginal_1, marginal_2)
pjoint(q, copula, marginal_1, marginal_2)
Arguments
n |
integer value, the number of random samples to be
generated with |
copula |
R object of class ' |
marginal_1 |
named list (for parametric estimates) or
a ' |
marginal_2 |
This input is similar to |
x |
matrix (or vector) of numeric values giving the points (in 2 dimensions) where the density function is evaluated. |
q |
matrix (or vector) of numeric values giving the points (in 2 dimensions) where the distribution function is evaluated. |
Details
If entered "by hand", the named lists describing the parametric distributions
(marginal_1 and marginal_2) must contain 2 entries:
name: a character string denoting the name of the distribution. For a circular distribution, it can be"vonmises","vonmisesmix", or"wrappedcauchy". For a linear distribution, it must be a string denoting the name of a linear distribution in the environment, i.e. the name of its distribution function without the "p", e.g. "norm" for normal distributioncoef: For a circular distributioncoefis a (named) list of parameters of the circular marginal distribution as taken by the functionsqvonmises(),qvonmisesmix(), orqwrappedcauchy(). For a linear distribution,coefis a named list containing the parameters of the distribution given in"name".
Value
djoint()gives a vector of lengthlength(x)containing the density atx.pjoint()gives a vector of lengthlength(q)containing the distribution function at the corresponding values ofq.rjoint()generates a vector of lengthncontaining the random samples.
Examples
cop <- copula::normalCopula(0.6)
marginal_1 <- list(name="exp",coef=list(rate=2))
marginal_2 <- list(name="lnorm", coef=list(0,0.1))
sample <- rjoint(10,cop,marginal_1,marginal_2)
pjoint(sample,cop,marginal_1,marginal_2)
djoint(sample,cop,marginal_1,marginal_2)
cop <- cyl_quadsec()
marginal_1 <- list(name="wrappedcauchy", coef=list(location=0,scale=0.3))
marginal_2 <- list(name="weibull",coef=list(shape=3))
sample <- rjoint(10,cop,marginal_1,marginal_2)
marginal_1 <- fit_angle(theta=sample[,1], parametric=FALSE)
marginal_2 <- fit_steplength(x=sample[,2],parametric="lnorm")
pjoint(c(0.3*pi,4),cop,marginal_1,marginal_2)
djoint(c(0,2),cop,marginal_1,marginal_2)