binom_weib: Weibull model for the psychometric function

View source: R/binom_weib.R

binom_weibR Documentation

Weibull model for the psychometric function

Description

This function finds the maximum likelihood estimates of the parameters of the Weibull model for the psychometric function.

Usage

binom_weib( r, m, x, p = 1, initK = 2, guessing = 0, lapsing = 0 )

Arguments

r

number of successes at points x

m

number of trials at points x

x

stimulus levels

p

(optional) degree of the polynomial; default is 1

initK

(optional) initial value for K (power parameter in Weibull model); default is 2

guessing

(optional) guessing rate; default is 0

lapsing

(optional) lapsing rate; default is 0

Value

⁠b ⁠ vector of estimated coefficients for the linear part

⁠K ⁠ estiamte of the power parameter in the Weibull model

⁠fit ⁠ glm object to be used in evaluation of fitted values

Examples

data("Miranda_Henson")
x = Miranda_Henson$x
r = Miranda_Henson$r
m = Miranda_Henson$m
numxfit <- 199; # Number of new points to be generated minus 1
xfit <- (max(x)-min(x)) * (0:numxfit) / numxfit + min(x)
val <- binom_weib( r, m, x )
# Plot the fitted curve
plot( x, r / m, xlim = c( 0.1, 1.302 ), ylim = c( 0.0165, 0.965 ), type = "p", pch="*" )
pfit <- predict( val$fit, data.frame( x = xfit ), type = "response" )
lines(xfit, pfit, col = "red" )


modelfree documentation built on May 31, 2023, 7:17 p.m.