adplus-dvertising
frame-decoration

Question

What will be the output of the following R code?
function(p) {
          params[!fixed] <- p
          mu <- params[1]
          sigma <- params[2]
## Calculate the Normal density
          a <- -0.5*length(data)*log(2*pi*sigma^2)
          b <- -0.5*sum((data-mu)^2) / (sigma^2)
          -(a + b)
}
> ls(environment(nLL))

a.

“data” “fixed” “param”

b.

“data” “variable” “params”

c.

“data” “fixed” “params”

d.

“data” “param”

Answer: (c).“data” “fixed” “params”

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following R code?