R/emg.R

Defines functions emg

Documented in emg

# EXPONENTIALLY MODIFIED GAUSSIAN FUNCTION (EMG)

#' Exponentially Modified Gaussian (EMG) prediction function, extracted from Angiletta 2006
#'
#' @param x A vector of values (In the context of the package, a vector of Temperature values)
#' @param h Value of the "h" new scale parameter
#' @param mu Value of the "mu" parameter, the mean of the Gaussian function
#' @param sigma Value of the "sigma" parameter, the sd of the Gaussian function
#' @param tau Value of the "tau" parameter, from the Exponential function
#'
#' @return A vector of predicted values (In the context of the package, a vector of Performance values)
#'
#' @examples
#'
#' @export

emg <- function(x,h,mu,sigma,tau){

  y <- ((h*sigma)/(tau))*sqrt(pi/2)*exp(0.5*(sigma/tau)^2 - (x - mu)/tau)*erfc((1/sqrt(2))*(sigma/tau - (x-mu)/sigma))

  return(y)
}
ggcostoya/tpcurves2 documentation built on Jan. 1, 2021, 2:19 a.m.