Displaying 1 result from an estimated 1 matches for "findlikelihood".
2003 Oct 28
2
outer function problems
I'm pulling my hair (and there's not much left!) on this one. Basically I'm
not getting the same result t when I "step" through the program and evaluate
each element separately than when I use the outer() function in the
FindLikelihood() function below.
Here's the functions:
Dk<- function(xk,A,B)
{
n0 *(A*exp(-0.5*(xk/w)^2) + B)
}
FindLikelihood <- function(Nk)
{
A <- seq(0.2,3,by=0.2)
B <- seq(0.2,3,by=0.2)
k <-7
L <- outer(A, B, function(A,B) sum( (Nk*log(Dk(seq(-k,k),A,B))) -
Dk(seq(-...