Hot answers tagged

4

Large? ? The relationship between normal and log returns is $$(normal return) = exp(log return)-1$$ Therefore log-returns can be from $-\infty$ to $+\infty$ while normal ones can only be between $-1$ and $+\infty$.


4

Perhaps overly simplistic and repeating the pt above, but when doing statistics, ideally we want to compare like with like. Returns can be comparable with each other. Prices on the other hand always depend on the previous price.


4

If you wanted to see the following (price $S_t$, log return $r$, simple return $R$) then $$ r = \log(S_{t+1}) - \log(S_t) = \log(S_{t+1}/S_{t}), $$ and $$ R = S_{t+1}/S_{t}-1, $$ thus $$ R = \exp(r)-1 $$ and $$r = \log(1+R).$$ Was this the question?


3

Just a bit of illustration added to @John's answer. Look at log prices $\log(P_t)$, assume that you know $P_0$ then $$ \log(P_t) = \log(P_0) + r_1 + \cdots r_t $$ where $r_i = \log(P_i)-\log(P_{i-1})$ are the log returns. By modelling the log-returns (which as already said take values on the whole real line which is a nice property for modelling) we model ...


3

Well, it wasn't easy because you didn't mentioned how your data is formatted. I create my own data.frame() basing on data you provided. You can skip this part if your data.frame is ready. Here's code I used to create a dataframe: > #given dates > dates=c("2000-1-3","2000-1-4","2000-1-5","2000-1-6","2000-1-7","2000-1-10","2000-1-11") > #formating ...


2

Computing returns is one of the first things you learn when you start studying finance but I believe it's one the trickiest one once you get to complicated cases. The source you mentioned seems actually very good to me and it already takes into account different approaches and different subtleties like dividend payment. But this is in fact only the top of ...


2

The result is: $ e^{(-230%)} - 1 = -89% $


1

The log likelihood function is indeed rather flat in the $\mu$-direction, for small time horizons (you used $T = 1$ it looks like). As you may have noticed, increasing the number of observations but keeping the time horizon the same DOES NOT IMPROVE the accuracy of the estimate of $\mu$ - this is a bit counterintuitive, if you ask me. But, increasing the ...


1

In theory, stock prices are lognormally distributed. People usually prove lognormality by referring to positivity and right skewness of stock prices. Mathematically (or philosophically if you wish), lognormality follows from the following equation $\frac{S}{dS}={\mu}dt+{\sigma}dW$, which you may see a lot in quantitative finance ("random walk") or in ...


1

In Python, simple geometric returns: import numpy as np import pandas as pd sp500 = pd.io.data.DataReader('^GSPC', 'yahoo')['Close'] simple_ret = sp500.pct_change() (1+simple_ret).cumprod()[-1] -1 0.74751768460019963 Log-returns: log_ret = np.log(1+simple_ret) np.exp(log_ret.cumsum()[-1]) -1 0.74751768460020074 In ...


1

When doing series like this in Python, I usually just add 1 to each return, then multiply across these sums for cumulative returns. Such as, if my returns over three days were -5.2%, 2.1% & 4.8%, then the values I would store would be: 1 + (-0.052) = 0.948 1 + (0.021) = 1.021 1 + (0.048) = 1.048 Then, to calculate my cumulative returns, I ...


1

In practice, when you encounter a relationship between historical financial variables that looks good on levels but not on returns, the model you get from it essentially always fails to be predictive. I generally think of this as being due to the historical relationship arising from some confounding third (plus fourth and fifth...) variable effects that ...


1

If you are short you need to use log((entryprice-fees)/exitprice). It is the same logic as in log long return case. You just need to change your entryprice and exitprice inputs. In this case, entryprice is the selling operation and exitprice will be the buying operation (just the opposite).


1

The high serial correlation you are getting in the first case is a spurious correlation. The correct way to do it is with returns. The price series has a unit root. You need to take diff(log(prices))) in order to have a stationary time series, on which you can then estimate autocorrelations, auto regressive coefficients, etc. properly. This was shown by ...



Only top voted, non community-wiki answers of a minimum length are eligible