And by the way.... [R for BE/BA]

posted by ElMaestro  – Belgium?, 2020-07-24 12:52 (19 d 16:12 ago) – Posting: # 21785
Views: 2,750

Obj.F12=function(Pars)
##returns the restricted log likelihood.
##apart from k, this is line 3 of page 10 of:
##http://people.csail.mit.edu/xiuming/docs/tutorials/reml.pdf
##k is defined from the number of observations, and .
{
  CovM=Create.CovM(Pars)
  k=  -((length(y)-ncol(X))/2)*log(2*pi)
  A= -0.5*log( det(CovM))
  B= -0.5*log( det(t(X) %*% solve(CovM) %*% X))
  est.b = solve(t(X) %*% solve(CovM) %*% X) %*% t(X) %*% solve(CovM) %*% y
  tmp= y - X %*% est.b
  C=-0.5 *(t(tmp) %*% solve(CovM) %*% tmp)
  return(k+A+B+C)
}


....this is exactly also the REML likelihood function that SAS defines.

I could be wrong, but...

Best regards,
ElMaestro

"Pass or fail" (D. Potvin et al., 2008)

Complete thread:

Activity
 Admin contact
21,009 posts in 4,379 threads, 1,460 registered users;
online 18 (0 registered, 18 guests [including 12 identified bots]).
Forum time: Thursday 05:04 CEST (Europe/Vienna)

If you obey all the rules,
you will miss all the fun.    Katharine Hepburn

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5