Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

17

Just to be painfully clear, it only seems to make sense to consider the logarithm of returns, i.e. $X=\log (1+\frac r{100})$ for a simple return of $r\%$ in an arbitrary period because this is what sums when returns are temporally aggregated. A basic property of cumulants is that cumulants of all orders are additive under convolution, for which a proof can ...


14

You are simply doing $log(S_t) - log(S_t) = 0$ for all $t$. Instead, try > n <- length(prices); > lrest <- log(prices[-1]/prices[-n]) Should do the trick.


12

In addition to John's answer and just to make things clear: The arithmetic mean is given by $$\mu_a = \frac{1}{n} \sum_{i=1}^n x_i$$ The geometric mean is given by $$\mu_g = \sqrt[n]{\prod_{i=1}^n (1+x_i)} -1$$ And we have that $$\mu_g \leq \mu_a$$ So not only would the geometric sharp ratio be taking into account the "actual" return of the ...


12

Basically, prices usually have a unit root, while returns can be assumed to be stationary. This is also called order of integration, a unit root means integrated of order 1, I(1), while stationary is order 0, I(0). Time series that are stationary have a lot of convenient properties for analysis. When a time series is non-stationary, then that means the ...


10

Looking at transaction prices, they would occur at the market bid if the active part is a seller, and at the ask if the active part is a buyer. With a random flow of sellers and buyers, the price will bounce between the bid and ask prices, creating a negative autocorrelation in returns. This penomenon is known as the bid-ask bounce, and has been discussed ...


9

I'm not sure it makes sense to think of one as more correct than another. However, they do have significant differences. It may help to distinguish between ex-post evaluation of a strategy and ex-ante prediction of what the strategy's performance will be. For simplicity, let's assume the log returns of the strategy are approximately i.i.d. univariate ...


9

I think this is a no-brainer. Only log-returns make sense. The average return can only be computed by averaging the sum of individual log returns. Taking the average of standard (relative) returns does not give you an average of the individual returns. Consider a simple case where the value of an investment alternates between 100 and 50 an odd number of ...


9

Hmm, this table looks wrong. Here's what it should look like. After the most recent corporate action, the Close and Adjusted Close should be the same; only prices from before the most recent action should have a different Adjusted Close. Here's another example. I think Yahoo just has the wrong information. If you wanted to derive your own adjustments for ...


9

Concerning adjusted price series: Free yourself from terminology and definitions, as you can clearly see, Yahoo Finance got it wrong on the stock split you linked to (and as chrisaycock correctly pointed out). You need to focus on the problem not the term people use to describe the problem: You need to adjust time series for the stock split, period. So, it ...


8

I believe the concept you are looking for without really knowing it is the information coefficient (IC). IC is the correlation between your forecast and actual subsequent returns. If your IC is 1 (perfect correlation, also known in this context as perfect foresight), then your maximum return is the compounded sum of the greatest daily return of any stock ...


8

You're forgetting that -2.52 is still in natural logarithm terms. So the correct answer is 2.71828183 raised to the -2.52 power which equals 0.08. Your ending portfolio value is 8% of what it was a year ago.


8

I think this is a no-brainer. Only log-returns make sense. The average return can only be computed by averaging the sum of individual log returns. Taking the average of standard (relative) returns does not give you an average of the individual returns. Consider a simple case where the value of an investment alternates between 100 and 50 an odd number of ...


8

Nowadays most quantitative researchers choose to use Information Ratio, developed and popularized by Grinold and Kahn (1999), as the gold standard for performance evaluation. Generally, though, it is called a Sharpe Ratio if returns are measured relative to the risk-free rate and an Information Ratio if returns are measured relative to some benchmark. ...


8

So those are cumulative pnl figures and you are interested in the percent changes in pnl from one data point to the next? Don't use log returns, simply generate the percent changes through r(t)/r(t-1)-1. 4.3922/5.2735-1 = -16.71% (in your example time series I made the assumption that the time series is in ascending order. Given your description of the ...


8

The initial investment is the capital in the account used to support the portfolio, not the cost of the assets in the portfolio. For example, when you sell a stock or bond short, your account doesn't actually accrue any cash. Instead you start receiving a regular cash flow. There isn't necessarily a difference between these quantities in a long-only ...


7

In long-short equities, it's common to use daily returns in $\frac{\mu}{\sigma}$ and then multiply by $\sqrt{252}$ to annualize.


7

We actually managed to come up with the answer to this question ourselves but wanted to share the answer since it might be relevant to others as well. The calculation depends on what method is used to calculate the cost. There is the FIFO, LIFO and the average cost method, see: http://www.accounting-basics-for-students.com/fifo-method.html If FIFO or LIFO ...


7

Usually the formula for the sample variance of a stock is given by: \begin{equation} Var(R_{i}) = E (R_t - E(R_t))^2 \end{equation} If you are using daily data to compute the variance then the second term: $E(R_t) \approx 0$, therefore you can drop it from the computation. Which yields: \begin{equation} Var(R_{i}) \approx E (R_t)^2 \end{equation} ...


6

Such tests should always be done using adjusted prices. In fact, ideally, you should reconstruct your own price series using the total returns series. To see this, suppose you have a 10:1 split rather than a relatively small cash dividend. Then it is clear that the cointegration relationship can only hold with respect to the adjusted series.


6

I don't feel I can give you an authoritative answer on what the "standard" approach is, maybe someone with more hands-on experience will be able to help. But my quick thoughts. As to the period, I've seen both daily and monthly returns being used. Weekly probably not that often. But in the end you annualize them either way to make them comparable. The ...


6

To expand on what Joshua has already stated, here is a truncated parameter list of similar functions, along with the package to which they belong. quantmod::Delt(x1,type = c("arithmetic", "log")) quantmod::periodReturn(x, type='arithmetic') # log would be "log" TTR::ROC(x, type=c("continuous", "discrete")) PerformanceAnalytics::CalculateReturns(prices, ...


6

For fixed income hedge funds, monthly returns are almost always used to calculate the Sharpe ratio, because some securities held are relatively illiquid and the dealers who do the pricing for the hedge funds are only willing to do month-end pricing. Daily returns are not available to be calculated for most such funds.


6

An easy way to perform what you need is do it this way: if your data are daily then : > prices <- data$cl > log_returns <- diff(log(prices), lag=1) would provide you with daily log returns, if you change the $lag=1$ to $lag=5$ then you will get weekly moving log returns.


6

I think the simplest method for calculating log returns is ROC from the TTR package: > data(ttrc) > roc <- ROC(ttrc[,"Close"]) https://CRAN.R-project.org/package=TTR


6

Whether its possible? Absolutely. However, you should probably keep in mind a couple points: * Many people claim a lot while proving very little to none. This is fine if the issue is a small-talk conversation. Believe it or not, no harm done. However, this is about money, and from my experience I cannot stress enough how important it is to do a very ...


6

The correct answer has some intuition though it doesn't generalize to continuous time very easily: Think about the paper below like this: $Var(X+Y) = Var(X) + Var(Y) + 2Cov(X,Y)$ The generalization is slightly hard because the dynamics of $\mu$ and $\sigma^2$ could be dependent for arbitrary returns. You can use a GMM estimator to derive the asymptotic ...


6

You cannot use the clt to test something, it is a theorem about convergence. You can only use a statistical test to test something which basis is in many cases the clt. In this case you could e.g. use a so called t-test. In R you would e.g. type: t.test(data.Rb,data.Ra) to test whether the difference in the means is significant.


6

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.


6

For client reporting purposes, it is customary to use discrete returns. For backtesting, it pretty much make no difference.


6

What you describe is known as the Equity Premium Puzzle - and it really is, as the name says, a real enigma: "The equity premium puzzle (EPP) is a phenomenon that describes the anomalously higher historical real returns of stocks over government bonds." Source: https://www.investopedia.com/terms/e/epp.asp#ixzz5HlCdHS2Z A good first introduction can be ...


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