R/profileCI.R

Defines functions profileCI

Documented in profileCI

profileCI<- function( obj, parName, 
                      CIlevel=.95, 
                      REML=FALSE){
  y<- obj$summary[,ifelse(REML,"lnProfileREML.FULL",
                           "lnProfileLike.FULL")]
  x<- obj$summary[,parName]
  logX<- log10( x)
  lGrid<- (seq( min(logX), max(logX),length.out=400))
  yGrid<- splint( logX, y, lGrid)
  yMax<- max(yGrid)
  ChiLevel<- qchisq(.95,1)
  ind<-  yMax - yGrid <= ChiLevel 
  CI<- range( lGrid[ind] )
  CI <- 10**CI
  return( CI)
}

Try the fields package in your browser

Any scripts or data that you put into this service are public.

fields documentation built on June 25, 2021, 5:08 p.m.