R/getMeanFunction.R

Defines functions getMeanFunction.smoof_wrapped_function getMeanFunction.smoof_function getMeanFunction

Documented in getMeanFunction

#' Return the true mean function in the noisy case.
#'
#' @template arg_smoof_function
#' @return [\code{function}]
#' @export
getMeanFunction = function(fn) {
  UseMethod("getMeanFunction")
}

#' @export
getMeanFunction.smoof_function = function(fn) {
  return(attr(fn, "fn.mean"))
}

#' @export
getMeanFunction.smoof_wrapped_function = function(fn) {
  return(getMeanFunction(getWrappedFunction(fn)))
}

Try the smoof package in your browser

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

smoof documentation built on March 31, 2023, 11:48 p.m.