AssetsCollection¶
An AssetsCollection in JuPOT is a container structure used to store a set of asset tickers, their corresponding expected returns and the covariance matrix.
The basic syntax for creating an AssetsCollection is
A = AssetsCollection(names, expected_returns, covariance)
Where A
is the variable AssetsCollection that holds the newly created AssetsCollection. names
is a Vector of Strings that holds the names of the asset tickers. expected_returns
is a Vector of Floats that contain the corresponding expected returns of every asset. covariance
is the associated Matrix of Floats for this AssetsCollection.
Once an A
AssetsCollection object is created, it can be modified by any of the functions below.
Function Descriptions¶
Function | Description |
---|---|
length(A) |
The number of assets in A |
getReturnForAsset(A, name) |
The expected returns of name in A |
setReturnForAsset(A, name, value) |
Sets name to value in A |
getVarForAsset(A, name) |
Gets the Variance of name in A |
setVarForAsset(A, name, value) |
Sets the Variance of name to value in A |
getCoVarForAssetPair(A, name1, name2) |
Gets the Covariance of name1 and name2 in A |
setCoVarForAssetPair(A, name1, name2, value) |
Sets the Covariance of name1 and name2 to value in A |
getCovariance(A) |
Gets the Covariance Matrix of A |
setCovariance(A, covariance) |
Sets the Covariance Matrix to covariance in A |
getReturns(A) |
Gets the Vector of Expected Returns in A |
setReturns(A, returns) |
Sets the Vector of Expected Returns to returns in A |
getNames(A) |
Gets the Vector of Names in A |
setNames(A, names) |
Sets the Vector of Names to names in A |
Errors¶
Error messages will stop the execution of any of the above functions and will not result in a change within the AssetsCollection.