Hi, I have this exercise to calculate D_x that is defined as following:
So far my program looks like this..
delta = 0.028559;
lx = @(x) exp(-integral(@(t) mu_x(t),0,x));
Dx = integral(@(t) exp(-delta*t)*lx(x+t)/lx(x), 0, inf,'ArrayValued', true);
res = zeros(size(x));
ind = x>97;
res(~ind) = a+b*exp(c*x(~ind));
res(ind) = a+b*exp(c*97)+(x(ind)-97)*0.001;
There are 2 main questions I struggle with this one. 1) Is the program correct? I get a higher value then expected and I don't understand how Matlab assign integrals. 2) How to I plot the results? Say x=61:101 for mu_x, l(x) and D_x?