# Model-free estimation of a psychometric function

## Example 6. Discrimination of image approximations

Nascimento, S.M.C., Foster, D.H., & Amano, K. “Psychophysical estimates of the number of spectral-reflectance basis functions needed to reproduce natural scenes”, Journal of the Optical Society of America A-Optics Image Science and Vision, 22 (6), 1017-1022, 2005.

Back to Examples

The subject was shown an image of a natural scene and an approximation of this image based on principal component analysis. The task was to distinguish between the images. The symbols in the figure below show the proportion of correct responses as a function of number of components in the approximation. There were 200 trials at each level pooled over a range of natural scenes.

Parametric and local linear fitting

Three different parametric models and the local linear fitting are used and fits are plotted against the measured psychometric data. Three different parametric models are fitted to these data: Gaussian (probit), Weibull, and reverse Weibull. Local linear fitting is also performed with the bandwidth `bwd` chosen by the minimising cross-validated deviance.

Load the data and plot the measured psychometric data (black dots), as follows. Notice that in the same example in Żychaluk and Foster(2009) Download PDF, the x-axis was reversed.

 ```data("06_Nascimento") x = example06\$x r = example06\$r m = example06\$m plot( x, r / m, xlim = c( 1.17, 7.8 ), ylim = c( 0.47, 1.03 ), type = "p", pch="*" ) # Limits set to match the MatLab```

1. For the Gaussian cumulative distribution function (black curve):

 ```guess = 1/2 # guessing rate laps = 0 # lapsing rateval <- binomfit_lims( r, m, x, link = "probit", guessing = guess, lapsing = laps ) numxfit <- 199 # Number of new points to be generated minus 1 xfit <- (max(x)-min(x)) * (0:numxfit) / numxfit + min(x) # Plot the fitted curve pfit<-predict( val\$fit, data.frame( x = xfit ), type = "response" ) lines(xfit, pfit )```

2. For the Weibull function (red curve):

 ```val <- binom_weib( r, m, x, guessing = guess, lapsing = laps ) # Plot the fitted curve pfit<-predict( val\$fit, data.frame( x = xfit ), type = "response" ) lines(xfit, pfit, col = "red" )```

3. For the reverse Weibull function (green curve):

 ```val <- binom_revweib( r, m, x, guessing = guess, lapsing = laps ) # Plot the fitted curve pfit<-predict( val\$fit, data.frame( x = xfit ), type = "response" ) lines(xfit, pfit, col = "green" )```

4. For the local linear fit (blue curve):

 ```bwd_min <- -min( diff( x ) ) # data is decreasing bwd_max <- max( x ) - min( x ) bwd <- bandwidth_cross_validation( r, m, x, c( bwd_min, bwd_max ) ) # Plot the fitted curve bwd <- bwd\$deviance # choose the estimate based on cross-validated deviance pfit <- locglmfit( xfit, r, m, x, bwd )\$pfit lines(xfit, pfit, col = "blue" )```

Back to Examples