How can I create this Cumulative Normal (Gaussian) Psychometric Function?

I am trying to create a function for the above, but this gives me errors.
function [a] = cumGaussPF(x,beta,alpha)
fx = @(x,beta,alpha) exp(-0.5*((x-alpha)/beta).^2);
pf = 1/(beta*sqrt(2*pi))*integral(@(x) fx(x,beta,alpha),-inf,x);
end

 Akzeptierte Antwort

Torsten
Torsten am 21 Feb. 2022
pf = normcdf(x,alpha,beta)

3 Kommentare

Thanks, after seeing your answer - I saw that this is exactly what I am trying to do. Thanks a great deal.
normcdf is a function from the Statistics and Machine Learning Toolbox.
If your code should not depend on a licence for this toolbox, you can also use
pf = 0.5*(1 + erf((x-alpha)/(sqrt(2)*beta)))

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by