lower_bd: lower bound of expit(x)

View source: R/utils.R

lower_bdR Documentation

lower bound of expit(x)

Description

lower bound is quadratic in the exponent

Usage

lower_bd(xi)

Arguments

xi

local variational parameter, positive value, this is where the expit(xi) = lower_bd(xi); this is where the quadratic and expit curve contact

Value

a positive value between 0 and 1

References

See Also

Other VI functions: approx_sb(), g_fun.vec(), g_fun0(), g_fun()

Examples


par(mfrow=c(2,3))
xi_seq <- c(0.1,0.5,1,2,4,6)
  x <- seq(-5,5,by=0.1)
for (i in 1:length(xi_seq)){
  xi <- xi_seq[i]
  y1 <- lower_bd(xi)(x)
  y2 <- lower_bd(-xi)(x)

  plot(x,y1,type="l",col="red",ylim=c(0,1),main=paste0("xi= ",xi))
  points(x,y2,type="l",col="blue")
  points(x,1/(1+exp(-x)),type="l",col="orange")
  abline(v=c(-xi,xi),col="gray")
  legend("topleft",c("expit","bound"),col=c("orange","blue"),lty=c(1,1))
}


zhenkewu/lotR documentation built on April 24, 2022, 2:36 a.m.