Question
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”
Posted under R Programming
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?
Similar Questions
Discover Related MCQs
Q. The _________ function is used to plot negative likelihood.
View solution
Q. ________ loop over a list and evaluate a function on each element.
View solution
Q. Point out the wrong statement?
View solution
Q. __________ function is same as lapply in R.
View solution
Q. Which of the following is multivariate version of lapply?
View solution
Q. Point out the correct statement?
View solution
Q. ________ applies a function over the margins of an array.
View solution
Q. _______ is used to apply a function over subsets of a vector.
View solution
Q. lappy functions takes _________ arguments in R language.
View solution
Q. Body of lapply function is?
View solution
Q. Point out the wrong statement?
View solution
Q. Point out the correct statement?
View solution
Q. The _____ function takes a vector or other objects and splits it into groups determined by a factor or list of factors.
View solution
Q. Which of the following is valid body of split function?
View solution
Q. Point out the correct statement?
View solution
Q. What will be the value of following R expression?
View solution
Q. The recover() function will first print out the function call stack when an _______ occurs.
View solution
Q. __________ prints out the function call stack after an error occurs.
View solution
Q. Point out the wrong statement?
View solution
Q. Which of the following is primary tool for debugging?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond R Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!