# This is autorun outside of examples
tawny:::.init()
# Estimate the covariance matrix based on the given asset returns
data(sp500.subset)
ys <- create(TawnyPortfolio, sp500.subset, 150)
S.hat <- cov_shrink(ys)
# Optimize the portfolio weights using the shrinkage estimator
ws <- optimizePortfolio(ys, create(ShrinkageFilter))
#plotPerformance(ys,ws, bg='white', name='Shrinkage')
# Calculate the sample covariance matrix
#S <- cov.sample(ys)
# Calculate the shrinkage coefficient
#F <- cov.prior.cc(S)
#k <- shrinkage.intensity(ys, F, S)Run the code above in your browser using DataLab