AssetCollections StdLib¶
Constructors¶
-
AssetsCollection
(names::Vector{AbstractString}, expected_returns::Vector{Real}, covariance::Matrix{Real})¶ Returns the constructed AssetsCollection from the given inputs. Will throw errors if
Getters and Setters¶
-
getReturnForAsset
(A, name::AbstractString)¶ Returns the value of the given asset
name
expected returns. Ifname
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname
-
setReturnForAsset
(A, name::AbstractString, value::Real)¶ Returns the
value
that was set as the expected return ofname
inA
. Ifname
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname
-
getVarForAsset
(A, name::AbstractString)¶ Returns the value of the variance of the given asset
name
. Ifname
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname
.
-
setVarForAsset
(A, name::AbstractString, value::Real)¶ Returns the
value
that was set as the variance ofname
inA
. Ifname
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname
-
getCoVarForAssetPair
(A, name1::AbstractString, name2::AbstractString)¶ Returns the value of the covariance between the assets
name1
andname2
. Ifname1
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname1
. Ifname2
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname2
. If bothname1
andname2
do not exist inA
, it will throw an error forname1
as the first error to be encountered.
-
setCoVarForAssetPair
(A, name1::AbstractString, name2::AbstractString, value::Real)¶ Returns the
value
that was set for the covariance between the assetsname1
andname2
. Ifname1
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname1
. Ifname2
does not exist inA
, it will throw an error: LoadError: The asset collection has no asset namedname2
. If bothname1
andname2
do not exist inA
, it will throw an error forname1
as the first error to be encountered.Will throw a warning if the
value
changed will cause the covariance matrix to no longer be positive semi-definite.
-
getCovariance
(A)¶ Returns the Covariance Matrix of Real values as a Matrix{Real} from asset collection
A
.
-
setCovariance
(A, covariance::Matrix{Real})¶ Returns the
covariance
that is set as the Covariance Matrix of the asset collectionA
. Will throw an error if thecovariance
to be changed will cause the covariance matrix to no longer be positive semi-definite.
-
getReturns
(A)¶ Returns a Vector{Real} of the expected returns from asset collection
A
.
-
setReturns
(A, returns::Vector{Real})¶ Returns the
returns
that is set as the expected returns of the asset collectionA
.
-
getNames
(A)¶ Returns a Vector{AbstractString} of the asset names from asset collection
A
.
-
setNames
(A, names::Vector{AbstractString})¶ Returns the
names
that are set as the asset names of the asset collectionA
.