inst/book/C-PortfolioOptimization/R/inR.R

# inR.R -- version 2010-12-24
ns <- 100L; na <- 10L
R <- array(rnorm(ns * na), dim = c(ns, ns))
R1 <- crossprod(R)/ns 
R2 <- ((ns - 1)/ns)*cov(R) + outer(colMeans(R), colMeans(R))
identical(R1,R2); stopifnot(all.equal(R1,R2))

Try the NMOF package in your browser

Any scripts or data that you put into this service are public.

NMOF documentation built on May 2, 2019, 6:39 p.m.