RGen | R Documentation |
Generate random R matrices with various user-defined properties via differential evolution (DE).
RGen(
Nvar = 3,
NMatrices = 1,
Minr = -1,
Maxr = 1,
MinEig = 0,
MaxIter = 200,
delta = 1e-08,
PRINT = FALSE,
Seed = NULL
)
Nvar |
(integer) The order of the generated correlation matrices. |
NMatrices |
(integer) Generate |
Minr |
(numeric > -1 and < Maxr) The minimum rij in
the generated R matrices. Default |
Maxr |
(numeric > Minr and <= 1). The maximum rij in the
generated R matrices. Default |
MinEig |
(numeric). Minimum size of the last eigenvalue of R. Default
|
MaxIter |
(integer) The maximum number of iterations
(i.e., generations) for the DE optimizer. Default |
delta |
(numeric > 0) A number that controls the convergence
accuracy of the differential evolution algorithm. Default |
PRINT |
(logical) When PRINT = TRUE the algorithm convergence status is printed.
Default |
Seed |
(integer) Initial random number seed. Default ( |
RGen
returns the following objects:
R (matrix) A list of generated correlation matrices.
converged: (logical) a logical that indicates the convergence status of the optimization for each matrix.
iter (integer) The number of cycles needed to reach a converged solution for each matrix.
Niels G. Waller
Ardia, D., Boudt, K., Carl, P., Mullen, K.M., Peterson, B.G. (2011) Differential Evolution with DEoptim. An Application to Non-Convex Portfolio Optimization. URL The R Journal, 3(1), 27-34. URL https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Ardia~et~al.pdf.
Georgescu, D. I., Higham, N. J., and Peters, G. W. (2018). Explicit solutions to correlation matrix completion problems, with an application to risk management and insurance. Royal Society Open Science, 5(3), 172348.
Mishra, S. K. (2007). Completing correlation matrices of arbitrary order by differential evolution method of global optimization: a Fortran program. Available at SSRN 968373.
Mullen, K.M, Ardia, D., Gil, D., Windover, D., Cline, J. (2011). DEoptim: An R Package for Global Optimization by Differential Evolution. Journal of Statistical Software, 40(6), 1-26. URL http://www.jstatsoft.org/v40/i06/.
Price, K.V., Storn, R.M., Lampinen J.A. (2005) Differential Evolution - A Practical Approach to Global Optimization. Berlin Heidelberg: Springer-Verlag. ISBN 3540209506.
Zhang, J. and Sanderson, A. (2009) Adaptive Differential Evolution Springer-Verlag. ISBN 978-3-642-01526-7
## Example 1: Generate random 4 x 4 Correlation matrices.
out <- RGen(Nvar = 4,
NMatrices = 4,
PRINT = TRUE,
Seed = 1)
# Check convergence status of all matrices
print( table(out$converged) )
print( round( out$R[[1]] , 3) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.