I have a quick R question since it seems like we have some users here. Plus you guys are a lot more tolerant of newbie type questions than the R list. I"m having a hard time matching the results up to my reading on the subject.
I'm running OLS regression on interest rates and index prices.
> lmLevel < lm(index~rates, data=df)
Then run a BP and DW test
> bptest(lmLevel)
studentized BreuschPagan test
data: lmLevel
BP = 2.1318, df = 1, pvalue = 0.1443
> dwtest(lmLevel)
DurbinWatson test
data: lmSReturn
DW = 0.3123, pvalue < 2.2e16
alternative hypothesis: true autocorrelation is greater than 0
re: bptest. With such a high pvalue, it's basically stating that there is conditional heteroskedasticity, correct?
re: dwtest. With a low DW number and very low pvalue. Positive serial correlation exists, correct?
So I then run a test to correct for both ..
> coeftest(lmLevel,vcoc=vcovHAC(lmLevel))
t test of coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 1579.9570 34.9740 45.175 < 2.2e16 ***
rates 124.6063 4.6965 26.532 < 2.2e16 ***

Signif. codes: 0 â€˜***â€™ 0.001 â€˜**â€™ 0.01 â€˜*â€™ 0.05 â€˜.â€™ 0.1 â€˜ â€™ 1
So are these now valid results?
Anyone using MatLab, Octave, SciPy, the Language R
Backtesting with R is a mixed blessing if you're dealing with EOD data because it drastically reduces the odds of curvefitting via reckless optimization as you are massively disincentivized to even think of optimizing due to time constraints. Absolute nightmare for backtesting with single asset intraday data, much less optimize on a portfolio level. However, the doParallel package has reduced the processing time to more bearable levels, but nowhere near TBLOX's speed: http://cran.rproject.org/web/packages/ ... index.html
I'm hoping R, given its open source nature, would include native parallel processing over subsequent updates, but as far I'm aware, the fastest numerical computing language is Julia: http://julialang.org/
Note: I primarily use the quantstrat package in R for backtesting. Contemplating making the switch to TB.
I'm hoping R, given its open source nature, would include native parallel processing over subsequent updates, but as far I'm aware, the fastest numerical computing language is Julia: http://julialang.org/
Note: I primarily use the quantstrat package in R for backtesting. Contemplating making the switch to TB.

 Full Member
 Posts: 24
 Joined: Fri Nov 02, 2012 4:20 am