llike.model.lmer: A llikelihood function for one set of parameters, for a...

Description Usage Arguments Examples

Description

A llikelihood function for one set of parameters, for a single random effect. The error is specified by errormodel, typically dbinom or dnorm.

It includes the likelihood of observing data given a response model (model) and its parameters (allparam), plus the hyper-likelihood of observing allparam given the hyperparameters, including hypermeans and covariance matrix. This is based off llike.model.occur.hierarch in fitLogisticMap.r, but differs in including the covariance in the hyper-model. If the argument mu, for hypermeans, is set NULL, the likelihood without the hyper-likelihood is returned.

Usage

1
2
3
llike.model.lmer(test, allparam, whichtest, data, trueN, model,
  sdmodel = constant, sdpar, errormodel = "Gauss", badparam = NULL,
  returnmodel = FALSE, mu, covar, fixed = NULL, debug = FALSE, ...)

Arguments

badparam

The name of a function (unquoted) that tests a set of model parameters for validity; must return TRUE if parameters are valid, otherwise FALSE.

debug

Logical. If TRUE, call browser to debug.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 

#' else if(errormodel=='GaussMultResid') 
{
 if(length(which(modeled<=0))>0) return(-Inf)       

With this option, model must always be > 0
 llike=dnorm(x=trueN,mean=modeled,sd=withinSD*modeled,log=TRUE)
}
else if(errormodel=='Flat') llike=rep(0,length(modeled))

## End(Not run)

forestgeo/ctfs documentation built on May 3, 2019, 6:44 p.m.