Using a dataframe, df
, containing several S&P500 stocks monthly returns, I generated the inputs required for the multivariate random normal distribution function rmsn
in the R package sn
:
library(moments)
library(sn)
muvec = apply(df, 2, mean)
covmat = cov(df)
skew = apply(df, 2, skewness)
rmsn(100, muvec, covmat, skew)
However, the randomly generated numbers do not contain the original column headers in my input vectors (e.g. "A", "B", "C"). Instead, the output of rmsn
contains generic names ("V1", "V2", "V3"). Is there a way to ensure that my original column headers are passed through into the output?