assets-distance {fAssets} | R Documentation |
Distance Measures
Description
Allows to measure the distance or similarity between assets.
Usage
assetsDist(x, method="cor", ...)
corDist(x)
kendallDist(x)
spearmanDist(x)
mutinfoDist(x, nbin=10)
euclideanDist(x)
maximumDist(x)
manhattanDist(x)
canberraDist(x)
binaryDist(x)
minkowskiDist(x)
braycurtisDist(x)
mahalanobisDist(x)
jaccardDist(x)
sorensenDist(x)
Arguments
x |
any rectangular time series object which can be converted by the
function |
method |
a character string, the method from which to compute the
distances. Allowed methods include |
nbin |
an integer value, the number of bins, by default 10. |
... |
optional argument to be passed the distance function. |
Details
corDist
, kendallDist
, and spearmanDist
call the
base cov
function from R.
mutinfoDist
calls the function mutinfo
from the contributed
R package bioDist
.
euclideanDist
, maximumDist
, manhattanDist
,
canberraDist
, binaryDist
, and minkowskiDist
are functions build on top of R's base package.
braycurtisDist
, mahalanobisDist
, jaccardDist
,
and sorensenDist
call functions from
the contributed R package ecodist
.
Value
an object of class dist
.
References
Wuertz, D., Chalabi, Y., Chen W., Ellis A. (2009); Portfolio Optimization with R/Rmetrics, Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.
Examples
## LPP -
# Load Swiss Pension Fund Data:
LPP <- LPP2005REC[, 1:6]
head(LPP)
## Returns correlation distance measure
corDist(LPP)
## Returns kendalls correlation distance measure
kendallDist(LPP)
## Returns spearmans correlation distance measure
spearmanDist(LPP)
## Return mutual information distance measure
mutinfoDist(LPP)
## Return Euclidean distance measure
euclideanDist(LPP)
## Return maximum distance measure
maximumDist(LPP)
## Return Manhattan distance measure
manhattanDist(LPP)
## Return Canberra distance measure
canberraDist(LPP)
## Return binary distance measure
binaryDist(LPP)
## Return Minkowsky distance measure
minkowskiDist(LPP)
## Return Bray Curtis distance measure
braycurtisDist(LPP)
## Return Mahalanobis distance measure
# mahalanobisDist(LPP)
## Return Jaccard distance mesaure
jaccardDist(LPP)
## Return Sorensen distance measure
sorensenDist(LPP)