No BSD License  

Highlights from
An Introduction to Stochastic Processes

image thumbnail
[X]=c3_mt_f(F,g,t)
function [X]=c3_mt_f(F,g,t)
%
%   Find the renewal function given cdf  F
%   Ref:  Xie, M. "On the Solution of Renewal-Type Integral Equations"
%   Commun. Statist. -Simula., 18(1), 281-293 (1989)
%
[n,m]=size(F); g0=g(1); g(1)=[];M=F;dno=1-g0;
M(1)=F(1)/dno;
for i=2:m
  sum=F(i)-g0*M(i-1);
  for j=1:i-1
     if j==1
     sum=sum+g(i-j)*M(j);
     else
     sum=sum+g(i-j)*(M(j)-M(j-1));
     end
  end
  M(i)=sum/dno;
end
%
%   Output the results
%
d=20;
x=[0]; Mt=[0];
for i=d:d:m
   y=i*t/m; x=[x y]; Mt=[Mt M(i)];
end 
m=length(x); X=zeros(m,2); X(:,1)=x'; X(:,2)=Mt';

Contact us at files@mathworks.com