### Deterministic cash-flow

The cash flow refers to the variation of money through the time. This variation may be due to the amount of money (price) or its appreciation (value). For example, if we invest 1€ and we get 2€ after 100 years, our amount of money has doubled :) However, due to the inflation, its value is likely to have decreased :( In other words, now, we can buy one coffee for 1€; but, in 100 years, we will not be able to buy the same coffee for 2€.

The deterministic approach comes from the assumption that we know the value of the return at the end of the period. This assumptions only holds when we talk about loan conditions for the future or we talk about the past. For example, if we put our 1€ in the bank with the condition that we will get 2€ at the end of the year without any risk, the return is deterministic. Besides, if we analyze the wage increase during the Hungarian hyperinflation of the 40's, the historical values are recorded; thus, the cash-flow is also deterministic. On the other hand, in case the return depends on any stochastic variable, we talk about probabilistic cash-flow.

The initial price of the asset is $P_0$ and the price after n-periods is $P_n$, where the n-index usually means one-year. Thus, it is possible to define the magnitude and ratio of price change during the n-th period as:
- Price difference: $DP_n=P_n-P_{n-1}$
- Price gain: $GP_n=P_n / P_{n-1}$

### Interest

The return/interest $R_n$ is the price difference $DP_n$ normalized respect to the initial price.
$$R_n=\dfrac{P_n-P_{n-1}}{P_{n-1}}=\dfrac{DP_n}{P_{n-1}}=\dfrac{P_n}{P_{n-1}}-1=GP_{n}-1$$
If the earnings are not reinvested, the interest is simple:
- Price after one period: $P_1=P_0+P_0 \cdot R_1$
- Price after n-periods: $P_n=P_{0} \cdot (1+\sum_{i=1}^{n} R_i)$
- Price after n-periods with constant interest: $P_n=P_{0} \cdot (1+n \cdot R_i) \; \; \; if \: R_i=R \; \; \; \forall \: i \in \{ 1,n \}$
If the earnings are reinvested to generate more earnings, the interest is compounded:
- Price after one period: $P_1=P_0+DP_1=P_0+P_0 \cdot R_1=P_0 \cdot (1+R_1) =P_0 \cdot GP_1$
- Price after n-periods: $P_n=P_{n-1} \cdot (1+R_n)=P_0 \cdot \prod_{i=1}^{n} (1+R_i)$
- Price after n-periods with constant interest: $P_n =P_0 \cdot (1+R)^n \; \; \; if \: R_i=R \; \; \; \forall \: i \in \{ 1,n \}$
- Price after n-periods with m-compoundings per period and constant interest: $P_n=P_0 \cdot (1+R/m)^{n \cdot m}=P_0 \cdot (1+R_{eff})^n$

The simple compounding corresponds to a geometric average. In the limit (infinite time), the final price corresponds to $\lim_{n \to \infty}P_n=P_0 \cdot e^{R \cdot n}$. The simple interest gives a linear growth, but the compounding gives an exponential growth because the initial capital for each period is growing.

 Fig 1. Effect of the compounding for an interest of 0.01 and 0.02.

### Continuous Interest

The continuous return ($r_n$) is the natural logarithm (bel) of the price gain in the n-th period ($GP_n$).
$$r_n=Ln(1+R_n)=Ln(GP_n)=Ln(P_n / P_{n-1})=Ln(P_n)-Ln(P_{n-1})=p_n-p_{n-1}$$
- Price after one period: $p_1=p_0+r_1 \rightarrow P_1=P_0 \cdot exp(r_1)$
- Price after n-periods:   $p_n=p_{n-1}+r_n =p_0+\sum_{i=1}^{n}r_i \rightarrow P_0=P_1 \cdot \prod_{i=1}^{n}exp(r_i)$
- Price after n-periods with constant interest: $p_n=p_0+n \cdot r \; \; \; if \: r_i=r \; \; \; \forall \: i \in \{ 1,n \}$

The continuous compounding corresponds to an arithmetic average, which allows to express a cash-flow as a linear expression that greatly facilitates the operations, c.f. geometric average of non-continuous interest. The simple return is always greater or equal than the continuous return, i.e. $R_n \geq r_n$. The equality is satisfied for small returns where its Taylor series decomposition is approximated by the first term, i.e. if $R_n < 1-2\%$, then $r_n = Ln(1+R_n) \simeq R_n$

### Portfolio

The portfolio is a collection of m assets/shares. The proportion of the invested capital in the j-th asset corresponds to $x_j$. Thus, if the total capital is $P$, the capital invested in the j-th asset corresponds to $P_j=x_j \cdot P$, where it is satisfied that $\sum_{j=1}^{m} x_j=1$ and $\sum_{j=1}^{m}P_j=P$. The aggregated portfolio return ($R_{pf}$,$r_{pf}$) is the weighted average of the single returns.
$$R_{pf}=\sum_{j=1}^{m}x_j \cdot R_j \; , \; r_{pf}=Ln(1+\sum_{j=1}^{m}x_j \cdot R_j)$$

### Inflation

The inflation ($\Pi_n$,$\pi_n$) is the difference of the Consumer Price Index (CPI) between the beginning and end of the studied period. It represents the loss of opportunity due to money devaluation.
$$\Pi_n=\frac{CPI_n-CPI_{n-1}}{CPI_{n-1}} \; , \; \pi_n=Ln \left ( \frac{CPI_n}{CPI_{n-1}} \right )$$
Thus, the real return is: $R_{n}^{real}=\frac{(1+R_n)}{(1+\Pi_n)} \; , \; r_{n}^{real}=r_n-\pi_n$