How to optimize a series of equations whose outputs are a variable of the subsequent equatinos
How to optimize a series of equations whose outputs are a variable of the subsequent equatinos
Loading saved threads...
angryserver · External communityPost link
External question — Quantitative Finance Stack Exchange
Author: angryserver
Original post: https://quant.stackexchange.com/questions/44716
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
The basic question is, given
$f(x) = y$
and
$f(y) = z$
, how can you find
$x$
such that
$z$
is at its maximum?
I can optimize each equation independently, but I do not know how to optimize when combining equations. A concrete example is as follows:
Imagine forex market that is made up of
$x$
and
$y$
, where
$x$
and
$y$
are both currencies. Users can send in
$x$
to receive
$y$
, and vice versa. The market structure is defined by
\begin{equation}
x * y = k
\end{equation}
where
$k$
is a constant number, say
$1$
, and the product of
$x$
and
$y$
must always be equal to this number.
The price of
$x$
or
$y$
is simply
$x / y$
, such that
$k$
always stays the same. If someone sends
$x'$
of the currency as payment and receives
$y'$
in return, the new equation for the market must be true.
\begin{equation}
\dfrac{(x + x')}{(y - y')} = k
\end{equation}
Given all this information, imagine you were to make a trade on two markets of this structure. How would you optimize your input,
$x0'$
, such that your output
$x_1'$
, is maximized, and
$y_0'$
is equivalent on both trades?
\begin{equation}
\dfrac{(x_0 + x_0')}{(y_0 - y_0')} = k_0 \;\;\; and \;\;\; \dfrac{(y_1 + y_0')}{(x_1 - x_1')} = k_1
\end{equation}
Quote
Report
Attack68 · External communityPost link
External answer — Quantitative Finance Stack Exchange
Author: Attack68
Original post: https://quant.stackexchange.com/a/44719
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
To optimize:
$$z = f(g(x))$$
using traditional calculus with chain rule:
$$ \frac{dz}{dx} = \frac{df}{dg} \frac{dg}{dx} $$
Set
$\frac{dz}{dx} = 0$
and that will determine either minimum, maximum or saddle points.
Quote
Report
Post Reply
Checking account access…