I am using a book with a function I would like to use. However I don't think I am getting the correct values from my function.
Here is the instruction from the book:
Here is the function as I have created it in MATLAB:
function [ shortProbability ] = pShort( zkt, zktStar, short)
if zkt > zktStar
shortProbability = 0;
else
normalizer = 1/(1-exp(-short*zktStar));
shortProbability = normalizer * (short * exp(-short*zkt));
end
end
The values I am plugging in are:
zkt = 0:1:100
zktStar = 50;
short = 0.01;
However my graph doesn't behave like the one which I am supposed to end up with, which is this:
I am getting this from the graph, which looks correct, however I don't think it is being normalized properly:
Can anyone help me to correct this function?