Description Usage Arguments Details Value Note Author(s) References See Also Examples
The function computes an intermediate multivariate correlation matrix with a specific RA(Retrospective Approximation) algorithm called bounding RA.
1 2 | BoundingRA(cor_matrix, invcdfnames, paramslists, m1 = 60, c1 = 2, c2 = 1,
delta1 = 1e-04, sigma0 = 0.01, epsilon = 1e+50, maxit = 1000)
|
cor_matrix |
The specified input correlation matrix. |
invcdfnames |
A character sequence of the marginals' inverse cdf names. |
paramslists |
A list contains lists of params of the marginals as the same order as invcdfnames, the names of the arguments of the inner lists should keep the same with the function arguments matching rules with the arguments of invcdfnames functions. |
m1 |
The initial sample size. |
c1 |
The sample-size multiplier(c1>1). |
c2 |
The step-size multiplier(c2>0). |
delta1 |
The initial step size(detla1>0). |
sigma0 |
The standard error tolerance. |
epsilon |
The initial error tolerance. |
maxit |
The maximum number of numerical searches. |
The function computes an intermediate multivariate correlation matrix with
a specific RA(Retrospective Approximation) algorithm called
bounding RA.Then the result matrix will be used to applying NORTA approach to get
n
observations which have specified marginals and target correlation matrix
cor_matrix
.
An intermediate normal correalation matrix of the same size as
cor_matrix
.
In this implementation of the NORTA approach with bounding RA algorithm according to the reference paper, the initial sample size is adjusted from 40 to 60, the other parameters remain the same. And the third choice of random seeds w_bar is used for efficiency while the Appendix of the paper uses the first choice.
Po Su
Huifen Chen, (2001) Initialization for NORTA: Generation of Random Vectors with Specified Marginals and Correlations. INFORMS Journal on Computing 13(4):312-331.
gennortaRA
, valid_input_cormat
,
check_input_cormat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
invcdfnames <- c("qt","qpois","qnorm")
paramslists <- list(
m1 = list(df = 3),
m2 = list(lambda = 5),
m3 = NULL # it means list(mean = 0, sd = 1)
)
cor_matrix <- matrix(c(1,0.5,-0.3,0.5,1,0.4,-0.3,0.4,1), 3)
Sigma <- BoundingRA(cor_matrix,invcdfnames,paramslists)
Sigma
invcdfnames <- c("qunif","qunif","qunif")
paramslists <- list(
m1 = NULL, #it means list(min = 0, max = 1)
m2 = NULL,
m3 = NULL
)
cor_matrix <- matrix(c(1,0.5,-0.3,0.5,1,0.4,-0.3,0.4,1), 3)
Sigma <- BoundingRA(cor_matrix,invcdfnames,paramslists)
Sigma
#NB:For element 0.5 in cor_matrix, the true root should be around 2*sin(0.5*3.14/6).
res <- sapply(c(0.5,-0.3,0.4), function(x){2*sin(x*pi/6)})
trueroots <- diag(1/2,3,3)
trueroots[upper.tri(trueroots)] <- res
trueroots <- trueroots + t(trueroots)
trueroots
abserrors <- abs(Sigma - trueroots)
abserrors
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.