# NOT RUN {
### Pairwise Beta :
# Examples on the 3-dimensional simplex
# Returns the bivariate angular density at two locations
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Pairwise", par=c(2,2,2,4),
log=FALSE, vectorial=TRUE)
# returns the likelihood function at two locations
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Pairwise", par=c(2,2,2,4),
log=FALSE, vectorial=FALSE)
# returns the log-likelihood function
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Pairwise", par=c(2,2,2,4),
log=TRUE, vectorial=FALSE)
# Examples on the 4-dimensional simplex
# returns the bivariate angular density at two locations
dens(x=rbind(c(0.1,0.3,0.3,0.3),c(0.1,0.2,0.3,0.4)), model="Pairwise", par=c(2,2,2,1,0.5,3,4),
log=FALSE, vectorial=TRUE)
# returns the likelihood function at two locations
dens(x=rbind(c(0.1,0.3,0.3,0.3),c(0.1,0.2,0.3,0.4)), model="Pairwise", par=c(2,2,2,1,0.5,3,4),
log=FALSE, vectorial=FALSE)
# returns the log-likelihood function
dens(x=rbind(c(0.1,0.3,0.3,0.3),c(0.1,0.2,0.3,0.4)), model="Pairwise", par=c(2,2,2,1,0.5,3,4),
log=TRUE, vectorial=FALSE)
### Husler-Reiss
# Example on the 2-dimensional simplex
# returns the log-likelihood at two locations
dens(x=rbind(c(0.1,0.9),c(0.3,0.7)), model="Husler", par=1.7,
log=TRUE, vectorial=FALSE)
# Example on the 3-dimensional simplex
# returns the likelihood function at two locations
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Husler", par=c(1.7,0.7,1.1),
log=FALSE, vectorial=FALSE)
# Example on the 4-dimensional simplex
# returns the bivariate angular density at two locations
dens(x=rbind(c(0.1,0.1,0.4,0.4),c(0.1,0.2,0.3,0.4)), model="Husler", par=rep(1,6),
log=FALSE, vectorial=TRUE)
### Dirichlet
# Example on the 2-dimensional simplex
# returns the log-likelihood at two points
dens(x=rbind(c(0.1,0.9),c(0.3,0.7)), model="Dirichlet", par=c(1.7,0.7),
log=TRUE, vectorial=FALSE)
# Example on the 3-dimensional simplex
# returns the likelihood function at three locations
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Dirichlet", par=c(1.7,0.7,1.1),
log=FALSE, vectorial=FALSE)
# Example on the 4-dimensional simplex
# returns the bivariate angular density at two locations
dens(x=rbind(c(0.1,0.1,0.4,0.4),c(0.1,0.2,0.3,0.4)), model="Dirichlet", par=c(1.7,0.7,1.1,0.1),
log=FALSE, vectorial=TRUE)
### Extremal-t
# Example on the 2-dimensional simplex
# Returns the log-likelihood
dens(x=rbind(c(0.4,0.6),c(0.3,0.7)), model="Extremalt", par=c(0.7,2), c=0.1,
log=TRUE, vectorial=FALSE)
# Density in the corner
dens(x=c(0.08,0.92), model="Extremalt", par=c(0.7,2), c=0.1,
log=FALSE, vectorial=FALSE)
# Example on the 3-dimensional simplex
# Returns the log-likelihood
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Extremalt", par=c(rep(0.1,3),2), c=0.03,
log=FALSE, vectorial=FALSE)
# Returns the evalutaion of the angular density at three locations:
# The first one is set to be on the edge linking the second and third components
# The second one is set to be on the interior of the simplex
# The third one is set to be on the corner near the third component
dens(x=rbind(c(0.001,0.3,0.699),c(0.1,0.2,0.7),c(0.001,0.001,0.998)),
model="Extremalt", par=c(rep(0.1,3),2), c=0.01, log=FALSE, vectorial=TRUE)
### Extremal Skew-t
# Example on the 2-dimensional simplex
# Returns the log-likelihood
dens(x=rbind(c(0.4,0.6),c(0.3,0.7)), model="Skewt", par=c(0.7,0,0,2), c=0.1,
log=TRUE, vectorial=FALSE)
dens(x=rbind(c(0.4,0.6),c(0.3,0.7)), model="Skewt", par=c(0.7,2,-1,2), c=0.1,
log=TRUE, vectorial=FALSE)
# Density in the corner
dens(x=c(0.08,0.92), model="Skewt", par=c(0.7,0,0,2), c=0.1,
log=FALSE, vectorial=FALSE)
dens(x=c(0.08,0.92), model="Skewt", par=c(0.7,-1,2,2), c=0.1,
log=FALSE, vectorial=FALSE)
# Example on the 3-dimensional simplex
# Returns the log-likelihood
dens(x=rbind(c(0.1,0.3,0.6),c(0.1,0.2,0.7)), model="Skewt", par=c(rep(0.1,3),rep(0,3),2), c=0.03,
log=FALSE, vectorial=FALSE)
# Returns the evalutaion of the angular density at three locations:
# The first one is set to be on the edge linking the second and third components
# The second one is set to be on the interior of the simplex
# The third one is set to be on the corner near the third component
dens(x=rbind(c(0.001,0.3,0.699),c(0.1,0.2,0.7),c(0.001,0.001,0.998)),
model="Skewt", par=c(rep(0.1,3),rep(0,3),2), c=0.01, log=FALSE, vectorial=TRUE)
### Asymmetric Logistic
# Example on the 3-dimensional simplex
# Returns the angular density at three points:
# The first one is set to be on the edge linking the second and third components
# The second one is set to be on the interior of the simplex
# The third one is set to be on the corner near the third component
dens(x=rbind(c(0.001,0.3,0.699),c(0.1,0.2,0.7),c(0.001,0.001,0.998)), c=0.05,
model="Asymmetric", par=c(1.2,1.8,4,2,rep(0.3,9)), log=FALSE, vectorial=TRUE)
# }
Run the code above in your browser using DataLab