Background:

In
Palamedes version 1.5.0 we modified the PAL_AMPM routines (which implement Kontsevich & Tyler’s
(1999) adaptive Psi-method) in order to allow users to place stimuli such as to optimize not only the estimation
of threshold (‘alpha’) and slope (‘beta’), but also (if so desired) the guess
rate (‘gamma’) and/or lapse rate (‘lambda’). In versions older than Palamedes 1.5.0, PM.pdf
was an array of size length(priorBetaValues) x length(priorAlphaValues). That is, values of alpha varied across
the second dimension of PM.pdf (columns) and values of beta varied across the first dimension (rows) of
PM.pdf. As of Palamedes version 1.5.0, PM.pdf may be up to 4-D. The first dimension will now be alpha, the
second dimension will now always be beta, the third dimension (if it exists) will always be gamma and the fourth
dimension (if it exists) will always be lambda. For an example of usage, see PAL_AMPM_Demo in the PalamedesDemos
folder.

Will this affect me?

This incompatibility will affect you ONLY if your code (written for older
versions of Palamedes) uses the Psi Method (i.e., calls on the PAL_AMPM routines) AND
you either (1) supply PAL_AMPM_setupPM with a user-defined prior and/or (2) perform
some operation on the posterior distribution (i.e., PM.pdf). For example, visualize it using ‘surf’
or ‘image’.

What is the fix that will make
my existing code compatible with Palamedes 1.5.0 (and higher)?

The
fix is simple: transpose the prior you created before it is passed to PAL_AMPM_setupPM (i.e.,
prior = prior';) and transpose the posterior
before you perform your operation on it (i.e., posterior = posterior';). See an example fix in context below.

Example
fix:
If your code written for a Palamedes version older than 1.5.0 is:

priorAlphaRange = -2:.02:2;

priorBetaRange
= -1:.02:1;

gamma = 0.5;

lambda = .01;

stimRange = [-.5:.05:.5];

%2-D Gaussian prior

[betas alphas] = ndgrid(priorBetaRange, priorAlphaRange);

prior = PAL_pdfNormal(alphas,0,3).*PAL_pdfNormal(betas,0,3);

prior = prior/ sum(sum(prior));

%set up procedure

PM = PAL_AMPM_setupPM('priorAlphaRange', priorAlphaRange, 'priorBetaRange', priorBetaRange, 'prior', prior,
'stimRange', stimRange, 'gamma', gamma, 'lambda', lambda);

while PM.stop ~= 1

%Stimulus presentation and response collection here

PM = PAL_AMPM_updatePM(PM,response);

end

posterior = PM.pdf;

surf(posterior);

… change it to the following to make it compatible with version 1.5.0 or higher (changes
indicated in red):

priorAlphaRange = -2:.02:2;

priorBetaRange = -1:.02:1;

gamma = 0.5;

lambda = .01;

stimRange = [-.5:.05:.5];

%2-D Gaussian prior

[betas alphas] = ndgrid(priorBetaRange, priorAlphaRange);

prior = PAL_pdfNormal(alphas,0,3).*PAL_pdfNormal(betas,0,3);

prior = prior/ sum(sum(prior));

prior = prior';

%set up procedure

PM = PAL_AMPM_setupPM('priorAlphaRange',
priorAlphaRange, 'priorBetaRange', priorBetaRange, 'prior', prior, 'stimRange', stimRange, 'gamma', gamma, 'lambda', lambda);

while PM.stop
~= 1

%Stimulus presentation and response collection here

PM = PAL_AMPM_updatePM(PM,response);

end

posterior = PM.pdf;

posterior = posterior';

surf(posterior);