makeTestData: Split data to create in-sample and out-of-sample data sets

Description Usage Arguments Value Author(s) Examples

View source: R/makeTestData.R

Description

#Give it an xts object and hold out pct, and it gives list with #first (1-ho.pct) percent of data, and last ho.pct of data

Usage

1
  makeTestData(x, ho.pct = 0.2)

Arguments

x

xts data object

ho.pct

percent of data to use for out-of-sample

Value

inSample

first data set; used to create model

outOfSample

second data set for confirming results found using 1st dataset

Author(s)

Garrett See

Examples

1
2
3
4
5
6
7
## Not run: 
getSymbols('SPY')
splitdata <- makeTestData(SPY)
tail(splitdata[[1]])
head(splitdata[[2]])

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.