assetsSelect
Asset Selection from Portfolios. }assetsSelect(x, method = c("hclust", "kmeans"),
kmeans.centers = 5, kmeans.maxiter = 10, doplot = TRUE, ...)
x
are chosen as the
initial centers.hclust
for hierarchical clustering of dissimilarities,
or kmeans
for k-means clustering.as.matrix()
into a matrix object, e.g. like an
object of class timeSeries
, data.frame
, or mts
.assetsSelect
if method="hclust"
was selected then the function returns a
S3 object of class "hclust", otherwise if method="kmeans"
was
selected then the function returns an obkject of class list. For
details we refer to the help pages of hclust
and kmeans
.assetsSelect
calls the functions hclust
or kmeans
from R's "stats"
package. hclust
performs a hierarchical cluster analysis on the set of dissimilarities
hclust(dist(t(x)))
and kmeans
performs a k-means
clustering on the data matrix itself.MultivariateDistribution
.## LPPt -
LPP = as.timeSeries(data(LPP2005REC))
colnames(LPP)
## assetsSelect -
# Hierarchical Clustering:
assetsSelect(LPP)
Run the code above in your browser using DataLab