AssetsCollection API¶
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
nameexpected returns. Ifnamedoes not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname
-
setReturnForAsset(A, name::AbstractString, value::Real)¶ Returns the
valuethat was set as the expected return ofnameinA. Ifnamedoes 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. Ifnamedoes not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname.
-
setVarForAsset(A, name::AbstractString, value::Real)¶ Returns the
valuethat was set as the variance ofnameinA. Ifnamedoes 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
name1andname2. Ifname1does not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname1. Ifname2does not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname2. If bothname1andname2do not exist inA, it will throw an error forname1as the first error to be encountered.
-
setCoVarForAssetPair(A, name1::AbstractString, name2::AbstractString, value::Real)¶ Returns the
valuethat was set for the covariance between the assetsname1andname2. Ifname1does not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname1. Ifname2does not exist inA, it will throw an error: LoadError: The asset collection has no asset namedname2. If bothname1andname2do not exist inA, it will throw an error forname1as the first error to be encountered.Will throw a warning if the
valuechanged 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
covariancethat is set as the Covariance Matrix of the asset collectionA. Will throw an error if thecovarianceto 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
returnsthat 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
namesthat are set as the asset names of the asset collectionA.