I have the time-series data for a lot of stocks from their specific groups (market indices), and I would like to perform some quantitative tests on them as a group. Let's say for example I have 30 stocks over a period of 10 years with daily information. It is stored as a cell (in Matlab) so basically a matrix with 30 columns and 2520 (10 x 252 trading days in a year) rows. Lets say I want to find the correlation matrix, i.e. the correlation between each pair of stocks. To do this you needs a regular (rectangular) matrix - but my problem is that, say 3 of the stocks appeared only 8, 6 and 5 years ago, so their columns are 2, 4 and 5 years shorter than the others, respectively.
I have two options to get my rectangular matrix
- chop of all data going further back that the oldest 'start-date' of a stock, which means losing 5 years of data in my example - not really an option.
- fill out, 'pad', the shorter columns to make them the same length as the longer stocks.
I have already removed one or two stocks as they are really young, and now want to pad the few remaining stocks that have shorter time series.
My question is: to what extent will my results be affected/skewed/biased if I pad those columns and run the analyses (correlation etc.).
Would the errors be negligible? Can I minimise them with my choice of what I pad them with? I have considered using 'NaN' in Matlab, as it functions neutrally in many other analyses, but here it would throw an error. My next best guesses would be to pad with zero, or with the mean value of that column (i.e. the mean stock price over the time series).
Any other ideas, or is padding a complete no-no?
Thanks in advance