What Will Be The Output Of The Following R Codep Pre Langrsplus #476
What will be the output of the following R code?</p> <pre><code class="language-rsplus"> 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)) </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs110 R Language. It can also be found in gs gs110 Control Structures, Functions, Scoping Rules, Loop Functions and Debugging - Scoping Rules - Quiz No.2.
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))
“data” “fixed” “param”
“data” “variable” “params”
“data” “fixed” “params”
“data” “param”