[go: up one dir, main page]

File: Rcode-6-1.R

package info (click to toggle)
urca 1.3-3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,432 kB
  • sloc: fortran: 501; ansic: 15; makefile: 2
file content (9 lines) | stat: -rwxr-xr-x 218 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
set.seed(123456)
e <- rnorm(500)
## trend
trd <- 1:500
S <- c(rep(0, 249), rep(1, 251))
## random walk with drift
y1 <- 0.1*trd + cumsum(e)
## random walk with drift and shift
y2 <- 0.1*trd + 10*S + cumsum(e)