data.gen.SW: Generate predictor and response data: Sinewave model

Description Usage Arguments Value Examples

View source: R/data_gen_SW.R

Description

Generate predictor and response data: Sinewave model

Usage

1
data.gen.SW(nobs = 512, fp = 25, fd, sd.x = 0.1, sd.y = 0.1)

Arguments

nobs

The data length to be generated.

fp

The frequencies in the generated response.

fd

A vector of frequencies for potential predictors. fd = c(3,5,10,15,25,30,55,70,95) used in the WRR paper.

sd.x

The noise level in the predictor.

sd.y

The noise level in the response.

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
#frequency, sampled from a given range
fd <- c(3,5,10,15,25,30,55,70,95)

data.SW1 <- data.gen.SW(nobs=512,fp=25,fd=fd)
data.SW3 <- data.gen.SW(nobs=512,fp=c(15,25,30),fd=fd)

ts.plot(ts(data.SW1$x),ts(data.SW3$x),col=c("black","red"))
plot.ts(cbind(data.SW1$x,data.SW1$dp))
plot.ts(cbind(data.SW3$x,data.SW3$dp))

zejiang-unsw/WASP_1.0.0 documentation built on May 6, 2020, 7:49 p.m.