data.gen.SW: Generate predictor and response data: Sinusoidal model In synthesis: Generate Synthetic Data from Statistical Models

Description

Generate predictor and response data: Sinusoidal model

Usage

 `1` ```data.gen.SW(nobs = 500, freq = 50, A = 2, phi = pi, mu = 0, sd = 1) ```

Arguments

 `nobs` The data length to be generated. `freq` The frequencies in the generated response. Default freq=50. `A` The amplitude of the sinusoidal series `phi` The phase of the sinusoidal series `mu` The mean of Gaussian noise in the variable. `sd` The standard deviation of Gaussian noise in the variable.

Value

A list of time and x.

References

Shumway, R. H., & Stoffer, D. S. (2011). Characteristics of Time Series. In D. S. Stoffer (Ed.), Time series analysis and its applications (pp. 8-14). New York : Springer.

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```### Sinusoidal model delta <- 1/12 # sampling rate, assuming monthly period.max<- 2^5 N = 6*period.max/delta scales<- 2^(0:5)[c(2,6)] #pick two scales scales ### scale, period, and frequency # freq=1/T; T=s/delta so freq = delta/s tmp <- NULL for(s in scales){ tmp <- cbind(tmp, data.gen.SW(nobs=N, freq = delta/s, A = 1, phi = 0, mu=0, sd = 0)\$x) } x <- rowSums(data.frame(tmp)) plot.ts(cbind(tmp,x), type = 'l', main=NA) ```

synthesis documentation built on Nov. 27, 2021, 5:07 p.m.