Skip to content
Prev 4534 / 20628 Next

Entry point for lme4a

On Mon, Oct 4, 2010 at 11:50 AM, Koala <skorsky12 at gmail.com> wrote:
Yes, that is the C++ function that evaluates the deviance.  It is
called repeatedly during the optimization of the deviance or REML
critterion.
I have tried to explain that there is no one C function the
corresponds to lmer.  If you look at the R code for lmer you will see
that a large amount of the code is written in the R language itself
and only the very core of the evaluation of the objective function is
written in the compiled language.  Expecting that there will be one C
function that you call and it "does lmer" for you is naive.  The lme4a
package depends strongly on the Matrix package, which, in turn,
depends on the CHOLMOD and AMD C libraries, and the MatrixModels
package and the Rcpp package and many, many facilities in base R.

If you have a very simple model and you need to implement the
calculations in C then I would suggest starting from the equations
rather than trying to find some magic C code that isn't there.  I'm
still at a loss to understand why you need to reimplement these
calculations in C.  I have been contacted in the past by software
vendors (Cytel) who thought that they could easily modify the lme4a
package to include such capabilities in proprietary software and this
is beginning to sound like that.

The lmer function is an R function that relies strongly on the
capabilities in base R and many R packages.  If you want to recreate
it from scratch in C you have a lot of work to do, much more than
simply discovering which C entry point to call.