Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.2K Views
|
7 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Minimizes a function (variance over 1mln data-points)?

Posted 10 years ago
Attachments:
POSTED BY: Sandu Ursu
7 Replies
Posted 10 years ago

Thank you very much all of you!

I was about to write that it freezes either way even if I ask for the minimum for the interval $(-4,-1)$, when I read Frank's paramount remark.

So much better now! :)

POSTED BY: Sandu Ursu
POSTED BY: Sander Huisman

I don't get any freeze with your code. However, it may run faster if you use the immediate assignment

fVarPut[\[Theta]_?NumberQ] = 
  Variance[E^(-r T) Ramp[
     K - S E^(\[Alpha] T + \[Sigma] Sqrt[
            T] (Z + \[Theta]))] E^(-\[Theta] (Z + \[Theta]) + \
\[Theta]^2/2)];

instead of the delayed assignment :=, because with delayed assignment Mathematica has to recalculate the Variance formula every time fVarPut is called.

POSTED BY: Gianluca Gorni
POSTED BY: Sander Huisman
Posted 10 years ago
POSTED BY: Sandu Ursu
POSTED BY: Frank Kampas
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard