# Tag Info

55

I am going to recommend something that I have no doubt will get people completely up in arms and probably get people to attack me. It happened in the past and I lost many points on StackOverflow as people downvoted my answer. I certainly hope people are more open minded in the quant forum. Note - It seems that this suggestion has created some strong ...

42

Consider the standard error, and in particular the distance between the upper and lower limits: $$\Delta = (\bar{x} + SE \cdot \alpha) - (\bar{x} - SE \cdot \alpha) = 2 \cdot SE \cdot \alpha$$ Using the formula for standard error, we can solve for sample size: n = \left(\frac{2 \cdot s \cdot \alpha}{\Delta}\...

40

My deal is HFT so what I care about is read/load data from file or DB quickly in memory perform very efficient data-munging operations (group,transform) visualize easily the data I think is is pretty clear that 3. goes to R, graphics and ggplot2 and others allow you to plot anything from scratch with little effort. About 1. and 2. I am amazed reading ...

24

Instead of wild guesses about R's/python's future in the community, here some facts: The following query on StackExchange Data Explorer counts the number of questions that have <r> or <python> tags. If you scroll down on one of the three webpages provided below, you can see a graph with data on a monthly basis. You can easily run this query on ...

23

I would consider a motion chart that plots the eigenvalues of the covariance matrix over time. For a static view you can create a table: rows represent dates, and columns represent eigenvectors. The entries of the table represent changes in the angle of the eigenvector from the previous row. This will show how stable your covariance structure is. You can ...

22

One of my favorites is a generalization of correlation: Distance Correlation (dCor) There are several reasons for that: It generalizes classical (i.e. linear) correlation in the sense that linearity is a special case. It gives identical readings for linear dependence. There are analogs for variance, covariance and standard deviation, so these identities ...

21

This is interesting because I see another trend: Matlab is being replaced by R, but I guess this is another story. I use R for my academic (I am also teaching this stuff) as well as my consulting work (I am mainly working in the $\mathbb{P}$ area, with some excursions into $\mathbb{Q}$). I tried Python but it didn't work for me. I think the main reasons I ...

21

I've used both R and Python with Pandas in a professional quantitative financial work to do both large and small scale projects. I would strongly recommend Python with Pandas over R for most new projects in the field especially in time series analysis. While I don't dispute vonjd in that you will find more libraries in R with algorithms on the bleeding ...

20

Variance ratio tests have been used numerous times to show that financial asset prices do not follow a random walk. You can for example look at -Lo and MacKinlay : Stock market prices do not follow a random walk : http://press.princeton.edu/books/lo/chapt2.pdf (US Stocks) -Hoque, Kim, Pyun: A comparison of variance ratio tests of random walk: A ...

16

You can use changepoint analysis to identify regime change. You can also look at large angle differences in the eigenvectors between your most up-to-date/recent covariance matrix and the covariance matrix from the prior window. Another way to identify regime change is using a factor model. If the returns on a particular set of factors is X standard ...

16

There are many different methods for this. Most people rely on a unit root test. Rmetrics has collected the most common unit root tests into the fUnitRoots package, which primarily provides a wrapper for Bernhard Pfaff's urca package. These include: Augmented Dickey–Fuller (ADF) test Elliott–Rothenberg–Stock test KPSS unit root test Phillips–Perron ...

15

Correlation is much more widely used concept and it has much more "informal" meanings. If we have only two random variables $X$ and $Y$ then correlation is simply a measure of linear dependence between the two variables: $$corr(X,Y)=\frac{cov(X,Y)}{\sqrt{var(X)var(Y)}}=\frac{EXY-EX\cdot EY}{\sqrt{var(X)var(Y)}}$$ If correlation is -1 or 1 then the two ...

14

You can forecast stock prices thru time-series models, cross-sectional, or panel models. There is considerable variation within these categories. In time-series models you would use an auto-regressive model such as an AR(1) where the independent variable is the dependent variable lagged by one period. Naturally, an AR(2) would consist of 2 lags and so on. ...

14

I don't know how to select ARMA lag length when doing ARMA-GARCH. Perhaps someone can edit it into this answer. For the univariate case you want rugarch package. If you're doing multivariate stuff you want rmgarch. The reason these are better than other packages is threefold; (i) Support for exogenous variables which I haven't seen in any other package, (ii)...

14

You could try Arctic. Other open source column-oriented databases that you may not have considered include LucidDB and C-Store.

14

All of the answers above (unfortunately highly upvoted at this point) are missing the point. You shouldn't pick a DBMS or storage solution by general performance benchmarks, you should pick it by use case. If someone says they get a "x ms read", "y inserts per second", "k times speedup", "store n TB data" or "have m years of experience" and use that to ...

13

Actually, co-skewness is represented by a rank 3 tensor, rather than a matrix. I'm going to reproduce the formulation from Bhandari and Das, Options on portfolios with higher-order moments, but I'll add and omit some details. The co-skewness tensor is $$S_{ijk} = E \left[ r_i \times r_j \times r_k \right] = \frac{1}{T} \sum_{t=1}^T r_i(t) \times r_j(t) \... 12 I think there are a lot of different ways to specify this problem. For simplicity, consider independent Garch processes$$ r_{1,t} \sim N\left(0,\sigma_{1,t}^{2}\right)  \sigma_{1,t}^{2} = \beta_{1,1}+\beta_{1,2}\varepsilon_{1,t-1}^{2}+\beta_{1,3}\sigma_{1,t-1}^{2} $$and$$ r_{2,t} \sim N\left(0,\sigma_{2,t}^{2}\right)  \sigma_{2,t}^{2} = \beta_{...

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 ...

12

For data analysis, particularly for large data analysis project, pretty much most of the top quant hedge funds and a lot of the banks are using Python (over R) for a couple of reasons but many still have bits and pieces of R for specific packages or functions (I work at a bank and interface with quite a few quant hedge funds on data analysis): Earlier ...

11

I have been using FastBit for a while now and find it to be quite performant. It's very non-intrusive to your existing binary storage format provided your data is stored in a columnar manner. I have briefly tested Tokyo/KyotoCabinet and didnt find it suitable for my (persistent storage) requirements.

11

I really wouldn't implement time series on my own unless I had a good reason to. AQR uses pandas, almost everyone in R using zoo or xts. I never like multiple parallel arrays, if it breaks everything is broken, plus it gets uglier as you increment data. If you are doing something in C++, why not have an array of structs for each object where you have ...

11

The standard answer is going to be that for time series, you want a column store database. These are optimized for range queries (ie: give me everything between two timestamps) because crucially, they store data along one of the dimensions (which you must choose, usually time) contiguously on disk, and thus reads are extremely fast. The alternative, when ...

10

If you are serious about performance and flexibility, you have to take a look at data.table package in R. Here is the crantastic review. It is lighting fast! I think this is the best package addressing performance and memory issues.

10

Here's an interesting possibility: correlation network analysis + motion chart. Thanks to the hot research efforts in social network analysis (SNA), network analysis and graphics libraries such as R and Gephis are now easily accessible. I am well-versed in correlation analysis, and have a feeling that SNA can be effectively adapted for it. After all, the '...

10

You can use the (Adjusted) Dickey Fuller Test: http://en.wikipedia.org/wiki/Dickey%E2%80%93Fuller_test I'm pretty sure your software package has a library or routine you can use to do it.

10

Here is a structured list of your bullet points: covariance, correlation, PCA, factor analysis, Are similar. They are based on Gaussian assumptions (i.e. correlations means dependencies) and try to identify common factors (i.e. a variable in small dimension) explaining the observed relationships. co-integration is more specific in the sense that you ...

10

Not so fast! I think it is of the utmost importance to first examine whether the data points are real outliers, i.e. noise that is contaminating the data, or perhaps the most important pieces of the time series! For example when you look at US stock market data of the last 50 years and remove only the ten biggest moves because they are outliers you get a ...

9

Why don't you try it and report back? Recall, though, that while a random walk is often a rather competitive forecast, realized data is understood to have weak dependence especially in higher moments. Having worked a bit with DieHarder, I'd suspect it to reject a number of series. But the proof is in the pudding...

9

Before I try to answer your question we need to establish a difference between what one wants to analyse. It is true that before modern time-series methodologies were developed, researches used "correlation" between prices as a means of analysis. However, since a Price (at a specific moment in time) is 1 value, it makes no sense to compare 2 prices with ...

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