28#include <ql/math/matrix.hpp>
29#include <ql/quote.hpp>
85 void addCorrelation(
const std::string& factor1,
const std::string& factor2, QuantLib::Real correlation);
89 const QuantLib::Handle<QuantLib::Quote>& correlation);
96 const QuantLib::Handle<QuantLib::Quote>& correlation);
114 const std::vector<std::string>& infIndices);
121 const std::vector<std::string>& infIndices,
122 const std::vector<std::string>& names);
130 const std::vector<std::string>& infIndices,
131 const std::vector<std::string>& names,
132 const std::vector<std::string>& equities);
144 typedef std::map<QuantExt::CrossAssetModel::AssetType, std::vector<std::pair<std::string, QuantLib::Size>>>
150 QuantLib::Handle<QuantLib::Quote>
lookup(
const std::string& f1,
const std::string& f2);
156 const std::map<CorrelationKey, QuantLib::Handle<QuantLib::Quote>>&
correlations();
164 const std::vector<std::string>& inflationIndices = {},
165 const std::vector<std::string>& creditNames = {},
166 const std::vector<std::string>& equityNames = {});
169 void checkFactor(
const CorrelationFactor& f)
const;
178 std::map<CorrelationKey, QuantLib::Handle<QuantLib::Quote>>
corrs_;
QuantLib::Matrix correlationMatrix(const std::vector< std::string > &ccys)
std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > corrs_
Store the correlation between two factors.
void addCorrelation(const std::string &factor1, const std::string &factor2, QuantLib::Real correlation)
QuantLib::Handle< QuantLib::Quote > lookup(const std::string &f1, const std::string &f2)
Get the correlation between two factors.
void addCorrelation(const std::string &factor1, const std::string &factor2, const QuantLib::Handle< QuantLib::Quote > &correlation)
QuantLib::Handle< QuantLib::Quote > getCorrelation(const CorrelationFactor &f_1, const CorrelationFactor &f_2) const
Get the correlation between the factor f_1 and f_2.
CorrelationKey createKey(const CorrelationFactor &f_1, const CorrelationFactor &f_2) const
void addCorrelation(const CorrelationFactor &f_1, const CorrelationFactor &f_2, const QuantLib::Handle< QuantLib::Quote > &correlation)
Add correlation quote between factor f_1 and f_2.
ProcessInfo createProcessInfo(const std::vector< std::string > &ccys, const std::vector< std::string > &inflationIndices={}, const std::vector< std::string > &creditNames={}, const std::vector< std::string > &equityNames={})
void checkFactor(const CorrelationFactor &f) const
Perform some basic checks on the factor names.
CorrelationMatrixBuilder()
void addCorrelation(const CorrelationFactor &f_1, const CorrelationFactor &f_2, QuantLib::Real correlation)
Add correlation between factor f_1 and f_2.
void reset()
Clear all data.
std::map< QuantExt::CrossAssetModel::AssetType, std::vector< std::pair< std::string, QuantLib::Size > > > ProcessInfo
const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > & correlations()
Get the raw correlation data.
bool operator<(const Dividend &d1, const Dividend &d2)
bool operator!=(const Filter &a, const Filter &b)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
bool operator==(const Dividend &d1, const Dividend &d)
std::pair< CorrelationFactor, CorrelationFactor > CorrelationKey
CorrelationFactor parseCorrelationFactor(const string &name, const char separator)
Serializable Credit Default Swap.
QuantExt::CrossAssetModel::AssetType type