Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

Column names not showing in random number generation using function 'rmsn' in R package 'sn'

$
0
0

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?

Output of random number generation


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>