https://github.com/cran/fields
Raw File
Tip revision: c71fb7f6ffa323303affebf0e35a0070faa9c24d authored by Doug Nychka on 10 May 2004, 00:00:00 UTC
version 1.7.2
Tip revision: c71fb7f
Krig.flplike.R
"Krig.flplike" <-
function (lam, obj) 
{

#  - log profile likelihood for lambda
# See section 3.4 from Nychka  Spatial Processes as Smoothers paper. 
# for equation and derivation

    lD <- obj$matrices$D * lam
    nn<- length( lD)
# 
    num<-  log( sum( (obj$matrices$u**2) * lD/(1 + lD) ) )/(nn-obj$nt)

# note subtle differences between den and RSS in Krig.fgcv 

#   log determinant of I-A restricted to nonzero eigenvalues
#   log det is the sum of the logs of the eigenvalues

    den<- sum( ifelse( lD>0, log(lD/(1 + lD)),0))
# NOTE: minus the likelihood! 
   .5* ( num-den) 
 
}
back to top