11
$\begingroup$

I have a few basic questions on block bootstrapping on a financial time series ('TS').

Assuming my trade universe consists of 10 stocks, I would like to create a set of synthetic prices for all 10 stocks plus the S&P500 index using their respective historical prices over the past 10 years. The bootstrap method should maintain, to a fair extent, the linear pairwise correlation among these 10 stocks and with the index at different points in time.

I read from academic literature and online resources that block bootstrap is appropriate for my endeavor. However, I still have the following 4 questions:

(1) I would be implementing in R. Assuming I set the same seed for all 10 stocks + index, does block bootstrap maintain the relative 'pairwise' correlation for them?

(2) Should all 10 stocks use the same block length or individual lengths? Some of the 10 stocks do not have 10 years of historical data.

(3) Is it more appropriate to bootstrap on daily returns or the absolute prices? The former leads to some very volatile outcomes (chart 1) while the latter leads to high 'gappy-ness' (chart 2) in the synthetic prices.

(4) If the answer to (3) is 'daily returns', should it be simple/discrete returns or log returns?

Hope to get some guidance and thanks in advance!

The charts are created in R using the boot package. Code for Chart 1 is given below the charts.

CHART 1 (Volatile - synthetic prices ended up 10x the actual at one point): enter image description here

CHART 2 (Gappy - gap down at start, followed by gap up in middle of chart): enter image description here

Code for Chart 1

library( quantmod )
library( np )
library( PerformanceAnalytics )
library( boot )

# Define dummy function
Fn <- function( aa ) { return ( aa ) }

u_seed <- 25

getSymbols( "AAL" )  # Get Price data

AAL_OHLC <- AAL[ , -( 5:6 ) ]  # Remove unwanted cols

plot( AAL$AAL.Close )

# Compute returns
AAL_DRet <- CalculateReturns( AAL_OHLC, method = "discrete" )
AAL_DRet2 <- AAL_DRet[ -1, ]

# Compute block length
tmp_len <- b.star( AAL_DRet2 )
blk_len <- round( median( tmp_len[ , 1 ] ), 0 )

AALC_DRet <- AAL_DRet2$AAL.Close

for( seed in u_seed )
{
  set.seed( seed )

  z <- tsboot( AALC_DRet, Fn, 1L, l = blk_len, endcorr = T, sim = "geom" )

  # Process new simulated data to xts
  a_BS <- z$t
  dim( a_BS ) <- NULL  # Flatten wide matrix into vector
  names( a_BS ) <- index( AALC_DRet )

  # Chg to xts
  xts_BS <- as.xts( a_BS )
  index( xts_BS ) <- index( AALC_DRet )

  # Plot relative chart
  xts_CumRet <- merge.xts( xts_BS, AALC_DRet )
  palette( bluefocus )
  chart.CumReturns( xts_CumRet, legend.loc = "top", geometric = T )
}
$\endgroup$
13
  • $\begingroup$ sorry but what to you mean by relative correlation? Do you mean pairwise linear correlation (i.e. Pearson correlation coefficient)? Also why would you like to create new points, isn't it enough to either (1) have a hold-out set for test purpose or (2) perform a K-fold cross-validation (with some tuning to account for the non iid-ness of time series data). $\endgroup$
    – Quantuple
    Jun 21, 2016 at 13:31
  • $\begingroup$ Chart 1 looks very strange (maybe a bug in the code?). The returns look much too volatile to have been sampled from the daily returns of the AAL chart at the bottom. In principle "sampling the returns" (not the level) is the right way to do it, but this chart looks strange. $\endgroup$
    – nbbo2
    Jun 21, 2016 at 14:11
  • $\begingroup$ Thanks for pointing out, @Quantuple, I have edited my question to make it clearer. Yes, I mean pairwise linear correlation (Pearson, beta, etc). To your 2nd question, actually, I do have a hold-out set for testing my system. I trained my system using the first 10 years of data while remaining 5 years went into the hold-out set. I don't like k-fold cross-validation because there is a possibility of look-ahead bias. I have tested my system on the hold-out set and I am currently embarking on testing on properly-synthesized data. $\endgroup$
    – NoviceProg
    Jun 21, 2016 at 16:16
  • $\begingroup$ To clarify what I meant by 'to a fair extent' in my question, essentially, if a pair of stocks or a stock with the index has a historical correlation of 0.8, I would expect the synthesized data to show, say, 0.5 correlation but not -0.5. $\endgroup$
    – NoviceProg
    Jun 21, 2016 at 16:16
  • $\begingroup$ Hi @noob2, I have added the R code in the question. I've eyeballed the code yet again but still couldn't find the bug (don't get me wrong, I really hope you're right that the volatility is just caused by a bug in my code). Alternatively, if there is something wrong in the way I implemented tsboot, please point it out. But I'm grateful as you've already answered Question 3, can I further ask if I should sample the simple/discrete return or log return (i.e. as per my question 4)? $\endgroup$
    – NoviceProg
    Jun 21, 2016 at 16:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.