Skip to content

Commit

Permalink
Merge pull request #18 from DonnaVakalis/patch-2
Browse files Browse the repository at this point in the history
Update newsvendor.qmd
  • Loading branch information
adityam authored Feb 9, 2024
2 parents f2c2455 + 08b02ce commit 0f46191
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stochastic-optimization/newsvendor.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ cost = Math.round(J(action)*100)/100
```{ojs}
//| layout-ncol: 3
//| label: fig-newsvendor
//| fig-cap: "An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shared region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function $r(a,\\cdot)$, which depends on the values of $p$ and $q$."
//| fig-cap: "An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shaded region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function $r(a,\\cdot)$, which depends on the values of $p$ and $q$."
//| fig-subcap:
//| - "Performance: ${cost}"
//| - "PDF of demand"
Expand Down Expand Up @@ -270,7 +270,7 @@ plotOptCts = Plot.plot({

Now, we come back to the problem with discrete actions and discrete demand.
Suppose $W$ takes the values $\ALPHABET W = \{ w_1, w_2, \dots, w_k \}$ (where $w_1 < w_2 <
\cdots < w_k$) with probabilities $\{ μ_1, μ_2, \dots, μ_k \}$. It is ease to
\cdots < w_k$) with probabilities $\{ μ_1, μ_2, \dots, μ_k \}$. It is easy to
see that in this case the action $a$ should be in the set $\{ w_1, w_2, \dots,
w_k \}$.

Expand Down Expand Up @@ -315,7 +315,7 @@ costD = Math.round(J(actionD)*100)/100
```{ojs}
//| layout-ncol: 3
//| label: fig-newsvendorD
//| fig-cap: "An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shared region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function $r(a,\\cdot)$, which depends on the values of $p$ and $q$."
//| fig-cap: "An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shaded region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function $r(a,\\cdot)$, which depends on the values of $p$ and $q$."
//| fig-subcap:
//| - "Performance: ${costD}"
//| - "PDF of demand"
Expand Down Expand Up @@ -465,7 +465,7 @@ Consider two scenarios for the case with continuous demand and actions. In scena

The amount $W$ of power generated by the wind turbine is a positive real-valued random variable with probability density function $f$. The operator of the wind turbine has to commit to provide a certain amount of power in the day-ahead market. The price of power is $\$p$ per MW.

If the operator commits to provide $a$ MW of power and the wind generation $W$ is less than $a$, then he has to buy the balance $a - W$ from a reserves market at the cost of $\$ q$ per unit, where $q > p$. Thus, the reward of the operator is $r(a,W)$ where
If the operator commits to provide $a$ MWs of power and the wind generation $W$ is less than $a$, then he has to buy the balance $a - W$ from a reserves market at the cost of $\$ q$ per unit, where $q > p$. Thus, the reward of the operator is $r(a,W)$ where
$$ r(a, w) = \begin{cases}
p a, & \text{if } w > a \\
p a - q (a - w), & \text{if } w < a.
Expand Down

0 comments on commit 0f46191

Please sign in to comment.