Skip to content

Commit

Permalink
Add example 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaakshat committed Nov 16, 2021
1 parent 7a36e51 commit 0b9a7c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ch10.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#############
# Chapter 10.2 Mean and correlation functions

## Example 10.5

# R code for Example 10.5
x = matrix(0, 1000, 20)
t = seq(-2, 2, (2+2)/999)

for (i in 1:20) {
x[,i] = runif(1) * cos(2 * pi * t)
}

matplot(t, x, lwd=2, col="gray")
lines(t, 0.5*cos(2*pi*t), lwd=4, col="darkred")
grid()

0 comments on commit 0b9a7c7

Please sign in to comment.