paramPersist {ttrTests} | R Documentation |
Divides the given data set into 2 subperiods and computes the correlation coefficient using a call to the 'subperiods' function. A p-value for the null hypothesis that there is no correlation in the underlying distribution is given using the bootstrapping procedure.
paramPersist(x, ttr = "macd4", start = 0, nSteps = 0, stepSize = 0, restrict = FALSE, bSamples = 25, model = "stationaryBootstrap", userParams = 4, burn = 0, short = FALSE, condition = NULL, silent = TRUE, TC = 0.001, loud = TRUE, plot = TRUE, alpha = 0.05, periods = 2, file = "", latex = "")
x |
A univariate series |
ttr |
The TTR to be used. Can be a character string for built-in TTRs, or a user defined function whose output is a position series s(t). See 'defaults' for a list of built-in TTRs. |
start |
Initial values for parameters |
nSteps |
How many parameter choices to use for each parameter |
stepSize |
The difference between successive choices of a parameter. |
restrict |
If restricted = TRUE, this will force the second parameter (and 4th, if applicable) to be strictly greater than the first (3rd, resp.) This is sensible if the pairs are moving average parameters. |
bSamples |
How many bootstrapped samples to generate |
model |
Passed to the function 'generateSample' |
userParams |
Passed to the function 'generateSample' |
burn |
When computing the position function s(t), values for t < burn will be forced to 0, i.e. no position held during the 'burn' period |
short |
Logical. If false the position function s(t) will be forced to 0 when it would otherwise be -1, i.e. no short selling |
condition |
An extra opportunity to restrict the TTR so that position is forced to 0 under some condition. Must be a binary string of the same length as the data 'x'. See 'position' for more details. |
silent |
Logical. If TRUE, supresses output from subroutines |
TC |
Percentage used to compute returns adjusted for trading costs. |
loud |
Logical. If FALSE, supresses output from the main function(s) |
plot |
Logical. If FALSE, supresses plot of regression data |
alpha |
Confidence level for 2-sided hypothesis testing |
periods |
How many periods to split up the original data. If default, the number of periods is decided based on the length of the data. |
file |
The full writable path string for a file to which output will be appended. Ideal for reviewing results. |
latex |
Full path name for a writable file. The laTeX code that generates a figure with a summary of the output will be appended to file. |
See the help file for 'paramStats' for important information about using "start,nSteps,stepSize" to define a domain of parameters
Output is a list containing the observed correlation coefficient, the mean and variance of correlation in bootstrapped samples, and the z-scores and p-values for hypothesis testing.
This procedure is very computationally intensive and requires a lot of resources for large data sets and large numbers of bootstrapped samples.
EXTREMELY IMPORTANT NOTE: The functions in this package evaluate past performance only. No warranty is made that the results of these tests should, or even can, be used to inform business decisions or make predictions of future events.
The author does not make any claim that any results will predict future performance. No such prediction is made, directly or implied, by the outputs of these function, and any attempt to use these function for such prediction is done solely at the risk of the end user.
David St John
This test was invented by the author to the best of his knowledge.
spData <- as.vector(getYahooData("SPY",start="20060101",end="20081231")[,"Close"]) pp <- paramPersist(spData,bSamples=3) pp