estimating psychometric functions in C