R/checklogicalbounds.R

Defines functions checklogicalbounds

Documented in checklogicalbounds

checklogicalbounds <- function(v) { ## just check logical bounds on the kriged variables.
  varnames <- colnames(blackbox.getOption("fitobject")$x)
  for (vit in varnames) {
    blob <- v[vit]
    if(islogscale(vit)) blob <- exp(blob)
    if (vit=="twoNmu") {if (blob<=0) {return(FALSE);} else {next;}}
    if (vit=="twoNm") {if (blob<=0) {return(FALSE);} else {next;}}
    if (vit=="g") {if (blob<0 || blob>1) {return(FALSE);} else {next;}}
    if (vit=="latt2Ns2") {if (blob<=0) {return(FALSE);} else {next;}}
    ## if we reach this point then...
    stop.redef(paste("(!) Unhandled variable", vit, "in checklogicalbounds()"))
  }
  ## if we reach this point then...
  return(TRUE)
} ## end def checklogicalbounds

Try the blackbox package in your browser

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

blackbox documentation built on May 3, 2023, 9:13 a.m.