data.gen.fm2: Friedman with correlated uniform variates

Description Usage Arguments Value Examples

View source: R/data_gen_Friedman.R

Description

Friedman with correlated uniform variates

Usage

1
data.gen.fm2(nobs, ndim = 9, r = 0.6, noise = 0)

Arguments

nobs

The data length to be generated.

ndim

The number of potential predictors (default is 9).

r

Target Spearman correlation.

noise

The noise level in the time series.

Value

A list of 3 elements: a vector of response (x), a matrix of potential predictors (dp) with each column containing one potential predictor, and a vector of true predictor numbers.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
###synthetic example - Friedman
#Friedman with independent uniform variates
data.fm1 <- data.gen.fm1(nobs=1000, ndim = 9, noise = 0)

#Friedman with correlated uniform variates
data.fm2 <- data.gen.fm2(nobs=1000, ndim = 9, r = 0.6, noise = 0)

plot.ts(cbind(data.fm1$x,data.fm2$x), col=c('red','blue'), main=NA, xlab=NA,
        ylab=c('Friedman with \n independent uniform variates',
        'Friedman with \n correlated uniform variates'))

synthesis documentation built on May 3, 2021, 9:07 a.m.