How do I statistically differentiate a series of prices from a series of returns?
How do I statistically differentiate a series of prices from a series of returns?
Loading saved threads...
SRKX · External communityPost link
External question — Quantitative Finance Stack Exchange
Author: SRKX
Original post: https://quant.stackexchange.com/questions/3666
License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I developed an optimization algorithm that uses returns (among other parameters) as input and basically output an allocation.
As I'm pretty happy with the results, I am in the process of putting the algorithm in production. As a matter of fact, I have to embed some checks into the algorithm to make sure that the input was right and that the output makes sense. For example, I check that the allocation sums to 1, I check that the time series provided are all of the same length and so on...
I would like to add another test which allows me to display a warning if the input time series appear to be prices instead of returns (and people
will
do this mistake one day I'm sure). So, I would like to setup a statistical test on my set of points $x=x_1, ... , x_n$ to determine whether they are likely to be prices.
Formally the statistical test if a function defined as follows:
$$A(x) \rightarrow \{0,1\}$$
Ideally we would like to find a test that is sufficient and necessary for a time series to be returns (as compared to prices, not to "a random time series").
There are three types of interesting statistical tests:
Type I (necessary and sufficient)
$$A(x)=1 \iff x ~ \text{are returns}$$
Type II (sufficient)
$$A(x)=1 \Longrightarrow x ~ \text{are returns}$$
Type III (necessary)
$$A(x) \neq 1 \Longrightarrow x ~ \text{are prices}$$
The following test is a dummy one:
$$A_{\text{dummy}}(x)=\frac{1}{n} \sum_{i=1}^n x_i > 1$$
This is not good because a Forex time series are prices of a currency expressed in the base currency of the portfolio, and such a series would produce a result of 1.
I came up with a Type II test:
$$A_\text{Type II}(x) = \exists i ~ x_i<0$$
Note that I assume that the input could be
either prices or returns
.
A series of prices with non-negative returns would fool this test so it is not necessary.
I believe it is impossible to come up with a Type I test, which implies that I can't come up with a Type III test either (otherwise I could construct a Type I test easily).
I would be looking for extra Type II tests to improve the probability of wrong input detection.
Have you ever had to do such test? What method would you recommend?
Quote
Report
Post Reply
Checking account access…