Skip to content

Commit

Permalink
deploy: a2f756a
Browse files Browse the repository at this point in the history
  • Loading branch information
masanorihirano committed Aug 27, 2024
1 parent fa3a548 commit 05abab2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _modules/pfhedge/stochastic/merton_jump.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,11 @@ <h1>Source code for pfhedge.stochastic.merton_jump</h1><div class="highlight"><p
<span class="n">randn</span> <span class="o">=</span> <span class="n">engine</span><span class="p">(</span><span class="o">*</span><span class="p">(</span><span class="n">n_paths</span><span class="p">,</span> <span class="n">n_steps</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">dtype</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">randn</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="n">drift</span> <span class="o">=</span> <span class="p">(</span>
<span class="p">(</span><span class="n">mu</span> <span class="o">-</span> <span class="p">(</span><span class="n">sigma</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">-</span> <span class="n">jump_per_year</span> <span class="o">*</span> <span class="p">(</span><span class="n">jump_mean</span> <span class="o">+</span> <span class="n">jump_std</span> <span class="o">**</span> <span class="mi">2</span> <span class="o">/</span> <span class="mi">2</span><span class="p">))</span>
<span class="p">(</span>
<span class="n">mu</span>
<span class="o">-</span> <span class="p">(</span><span class="n">sigma</span> <span class="o">**</span> <span class="mi">2</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span>
<span class="o">-</span> <span class="n">jump_per_year</span> <span class="o">*</span> <span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">jump_mean</span> <span class="o">+</span> <span class="n">jump_std</span> <span class="o">**</span> <span class="mi">2</span> <span class="o">/</span> <span class="mi">2</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
<span class="p">)</span>
<span class="o">*</span> <span class="n">dt</span>
<span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">n_steps</span><span class="p">)</span><span class="o">.</span><span class="n">to</span><span class="p">(</span><span class="n">randn</span><span class="p">)</span>
<span class="p">)</span>
Expand Down

0 comments on commit 05abab2

Please sign in to comment.