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

posted by ElMaestro  – Denmark, 2020-07-24 14:52 (1812 d 04:35 ago) – Posting: # 21785
Views: 29,871

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.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,429 posts in 4,930 threads, 1,679 registered users;
49 visitors (0 registered, 49 guests [including 6 identified bots]).
Forum time: 19:27 CEST (Europe/Vienna)

To know that we know what we know,
and to know that we do not know what we do not know,
that is true knowledge.    Nicolaus Copernicus

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