Showing posts with label Cosine wave with period 50 points R language. Show all posts
Showing posts with label Cosine wave with period 50 points R language. Show all posts

Wednesday, November 28, 2018

Cosine wave with period 50 points R

Cosine wave

wave with period 50 points (top panel) compared with the cosine wave contaminated with additive white Gaussian noise, σw = 1 (middle panel) and σw = 5 (bottom panel);
> cs = 2*cos(2*pi*1:500/50 + .6*pi)
> w = rnorm(500,0,1)
> par(mfrow=c(3,1), mar=c(3,2,2,1), cex.main=1.5)
> plot.ts(cs, main=expression(2*cos(2*pi*t/50+.6*pi)))
> plot.ts(cs+w, main=expression(2*cos(2*pi*t/50+.6*pi) + N(0,1)))
> plot.ts(cs+5*w, main=expression(2*cos(2*pi*t/50+.6*pi) + N(0,25)))
Cosine wave in r

Black-Scholes formula-R

 Black-Scholes formula-R > BlackScholes <- function(TypeFlag = c("c", "p"), S, X, Time, r, b, sigma) { TypeFla...