Skip to content

Commit 4200b7f

Browse files
changed title, and edited finance example
1 parent 1d4daf4 commit 4200b7f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Chapter5_/LossFunctions.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"cell_type": "markdown",
7676
"metadata": {},
7777
"source": [
78-
"# Chapter 4: \n",
78+
"# Chapter 5: \n",
7979
"____\n",
8080
"## Would you rather lose an arm or a leg?"
8181
]
@@ -574,9 +574,11 @@
574574
"____\n",
575575
"### Example: Financial prediction\n",
576576
"\n",
577-
"Suppose the return of a stock price is very small, say 0.01. We would still much rather have our prediction on the *right side of the return*, that is, to get the sign of the return correct. A squared-error loss is agnogstic to the signage, and would penalize a prediction of -0.01 equally as a prediction of 0.03, but this difference could result in loss or profit respectively. \n",
577+
"Suppose the future return of a stock price is very small, say 0.01 (or 1%). We have a model that predicts the stock's future price, and our profit and loss is directly tied to us acting on the prediction. How should be measure the loss associated with the model's predictions, and subsequent future predictions? A squared-error loss is agnogstic to the signage and would penalize a prediction of -0.01 equally as bad a prediction of 0.03:\n",
578578
"\n",
579-
"Let's define the following loss:"
579+
"$$ \\(0.01 - (-0.01) \\)^2 = (0.01 - 0.03)^2 = 0.004$$\n",
580+
"\n",
581+
"If you had made a bet based on your model's prediction, you would have earned money with a prediction of 0.03, and lost money with a prediction of -0.01, yet our loss did not capture this. We need a better loss that takes into account the *sign* of the prediction and true value. We design a new loss that is better for financial applications below:"
580582
]
581583
},
582584
{

0 commit comments

Comments
 (0)