Skip to contents

plotL() plots the likelihood, plotl() plots the log-likelihood

Usage

plotL(
  x,
  l,
  xlab = expression(theta),
  ylab = expression(L(theta)),
  bty = "n",
  col,
  add = FALSE,
  ...
)

plotl(
  x,
  l,
  xlab = expression(theta),
  ylab = expression("\u2113" * (theta)),
  bty = "n",
  col,
  add = FALSE,
  ...
)

Arguments

x

Parameter values (on x axis)

l

Likelihood / log-likelihood (on y axis)

xlab

Default: theta

ylab

Default: L(theta)

bty

Default: no boundary box

col

Color (or vector of colors, if l is a matrix)

add

Add to existing plot? Default: FALSE

...

Further arguments to plot()

Examples

x <- seq(-3, 4, length=99)
L <- dnorm(1, x)
l <- dnorm(1, x, log=TRUE)
plotL(x, L)

plotl(x, l)

L <- cbind(dnorm(1, x), dnorm(2, x))
l <- cbind(dnorm(1, x, log=TRUE), dnorm(2, x, log=TRUE))
plotL(x, L)

plotl(x, l)