Closed afoster28 closed 7 months ago
More details on mean, variance, standard deviation calculations:
Calculate portfolio payout as the sum of payout of all options (currently stored as optionPayouts vector in the code) per scenario price
For example using:
// Function to calculate the sum of values per price (row)
std::vector
for (const auto& row : payouts) {
double rowSum = 0.0;
for (const auto& value : row) {
rowSum += value;
}
rowSums.push_back(rowSum);
}
return rowSums;
}