Learn R Programming

MPDiR (version 0.2)

lpois: Likelihoods for Poisson and Gaussian psychometric functions

Description

These functions define likelihoods for binomial models with Gaussian or Poisson psychometric functions.

Usage

lpois(p, d)
lpois1(q, p, d)
lnorm(p, d)

Value

Returns a numeric value giving minus the log likelihood for the given model.

Arguments

p

numeric vector of parameters (in lpois and lnorm) or fixed Poisson parameter (lpois2).

d

data frame with number of correct (nyes) and incorrect (nno) responses and intensity levels (Q)

q

numeric vector of length 1 giving scale parameter (lpois2)

Author

Kenneth Knoblauch

Details

These functions calculate the log likelihood for binomial models with Gaussian or Poisson psychometric functions and can be used with optim to find the best parameters.

See Also

See optim

Examples

Run this code
data(HSP)
SHR2 <- subset(HSP, Obs == "SH" & Run == "R2")
SHR2 <- within(SHR2, {
	nyes <- N * p/100
	nno <- N - nyes
	})
optim(par = c(5, 0.35), lnorm, d = SHR2)

Run the code above in your browser using DataLab