logo

Model-free estimation of a psychometric function

locglmfit

Back to Functions

[pfit,etafit,H] = locglmfit(xfit,r,m,x,h,link,guessing,lapsing,K,p,ker,maxiter,tol);

Local polynomial estimator for the psychometric function and eta function (psychometric function transformed by link) for binomial data; also returns the hat matrix H. Actual calculations are done in LOCGLMFIT_PRIVATE or LOCGLMFIT_SPARSE_PRIVATE depending on the size of the data set. Here, the data are split into several parts to speed up the calculations.

Input:

xfit: points at which to calculate the estimate pfit

r: number of successes at points x

m: number of trials at points x

x: stimulus levels

h: bandwidth(s)

Optional Input:

link: name of the link function; default is 'logit'

guessing: guessing rate; default is 0

lapsing: lapsing rate; default is 0

K: power parameter for Weibull and reverse Weibull link; default is 2

p: degree of the polynomial; default is 1

ker: kernel function for weights; default is 'normpdf'

maxiter: maximum number of iterations in Fisher scoring; default is 50

tol: tolerance level at which to stop Fisher scoring; default is 1e-6

Output:

pfit: value of the local polynomial estimate at points xfit

etafit: estimate of eta (link of pfit)

H: hat matrix

Back to Functions