Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit ad24566

Browse files
committed
Corrected paths
1 parent 9ff4833 commit ad24566

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Tutorial.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
"metadata": {},
9292
"outputs": [],
9393
"source": [
94-
"M0 = 1000\n",
95-
"M1 = 10000\n",
96-
"N = 10**6\n",
94+
"M0 = 10\n",
95+
"M1 = 100\n",
96+
"N = 10**3\n",
9797
"T = 1\n",
9898
"\n",
9999
"XVAS: Dict[str, float] = {\"CVA\": 0.5}\n",

src/nmc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ void NMC::run(XVA xva, double factor, const std::map<ExternalPaths, std::vector<
131131
}
132132
}
133133

134+
#ifdef DEBUG
135+
std::cout << "Mean internal paths computed" << std::endl;
136+
#endif
137+
134138
for (size_t i = 0; i < nb_points; i++)
135139
{
136140
double sum = 0;
@@ -303,6 +307,7 @@ void NMC::generate_internal_paths(const Matrix &external_paths, Matrix &paths) c
303307

304308
for (size_t i = 0; i < m1; i++)
305309
{
310+
paths[i].push_back(external_paths[0][0]);
306311
for (size_t j = 1; j < nb_points; j++)
307312
{
308313
double dW = std::normal_distribution<double>(0.0, std::sqrt(dt))(gen);

0 commit comments

Comments
 (0)