Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
utilities.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd.
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file orea/simm/utilities.hpp
20 \brief supporting utilities
21*/
22
23#pragma once
24
29#include <ql/math/matrix.hpp>
30#include <string>
31#include <vector>
32
33namespace ore {
34namespace analytics {
35
36std::vector<std::string> loadFactorList(const std::string& inputFileName, const char delim = '\n');
37
38std::vector<std::vector<double>> loadScenarios(const std::string& inputFileName, const char delim = '\n');
39
40QuantLib::Matrix loadCovarianceMatrix(const std::string& inputFileName, const char delim = '\n');
41
42//! Ordered SIMM versions
44
45SimmVersion parseSimmVersion(const std::string& version);
46
47QuantLib::ext::shared_ptr<SimmConfiguration>
48buildSimmConfiguration(const std::string& simmVersion, const QuantLib::ext::shared_ptr<SimmBucketMapper>& simmBucketMapper,
49 const QuantLib::ext::shared_ptr<SimmCalibrationData>& simmCalibrationData = nullptr,
50 const QuantExt::Size& mporDays = 10);
51
52//! If the input *str* is a comma seperated list the method quotation marks " if the csvQuoteChar is '\0'
53//! Example:
54//! commaSeparatedListToJsonArrayString("item1,item2", '') -> "item1, item2"
55//! commaSeparatedListToJsonArrayString("item", '') -> "item"
56std::string escapeCommaSeparatedList(const std::string& str, const char& csvQuoteChar);
57
58} // namespace analytics
59} // namespace ore
std::vector< std::vector< double > > loadScenarios(const std::string &inputFileName, const char delim)
Definition: utilities.cpp:78
std::vector< std::string > loadFactorList(const std::string &inputFileName, const char delim)
Definition: utilities.cpp:55
SimmVersion
Ordered SIMM versions.
Definition: utilities.hpp:43
std::string escapeCommaSeparatedList(const std::string &str, const char &csvQuoteChar)
Definition: utilities.cpp:248
SimmVersion parseSimmVersion(const string &version)
Definition: utilities.cpp:162
QuantLib::ext::shared_ptr< SimmConfiguration > buildSimmConfiguration(const string &simmVersion, const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const QuantLib::ext::shared_ptr< SimmCalibrationData > &simmCalibrationData, const Size &mporDays)
Definition: utilities.cpp:191
Matrix loadCovarianceMatrix(const std::string &inputFileName, const char delim)
Definition: utilities.cpp:114
Abstract base class for classes that map SIMM qualifiers to buckets.
SIMM class for defining SIMM risk weights, thresholds, buckets, and labels. Currently only supports t...
SIMM configuration interface.