I will like to write a code for values of x = (-0.1, 0.0, 0.1)
write code to calculate L (x ; mu = 0, sigma = 1)
In R code(L <-function(x, u=0, s2=1)(sqrt(2*pi*s2))^-1*exp(-(x-u)^2/(2*s2))
x<-c(-0.1,0.0, 0.1)
L(-0.1)
L(0.0)
L(0.1)
Also using
dnorm(-0.1, mean = 0, sd = 1)
dnorm(0.0, mean = 0, sd = 1)
dnorm(0.1, mean = 0, sd = 1)
dnorm(c(-0.1,0.0,0.1),mean = 0, sd = 1)
yield as results in R.
[1] 0.396952547477
[1] 0.398942280401
[1] 0.396952547477
[1] 0.396952547477 0.398942280401 0.396952547477
I want to write equations in either IML or Macro language