T = 3; % The number of time periods.
SS = 3; % The number of possible treatment options.
HS = 3; % The number of possible health states.
N = 10000; % The number of cases.
DR = 0.8; % Discount rate.
mdiscrepancy = []; % Q-variations.
% Define the possible health states (including the disease history) in each time period.
SqDiz1 = 1;
SqDiz2 = [1,1;1,2;1,3];
SqDiz3 = [1,1,1;1,1,2;1,1,3;1,2,1;1,2,2;1,2,3;1,3,1;1,3,2;1,3,3];
SqDiz4 = [1,1,1,1;1,1,1,2;1,1,1,3;1,1,2,1;1,1,2,2;1,1,2,3;...
1,1,3,1;1,1,3,2;1,1,3,3;1,2,1,1;1,2,1,2;1,2,1,3;...
1,2,2,1;1,2,2,2;1,2,2,3;1,2,3,1;1,2,3,2;1,2,3,3;...
1,3,1,1;1,3,1,2;1,3,1,3;1,3,2,1;1,3,2,2;1,3,2,3;...
1,3,3,1;1,3,3,2;1,3,3,3];
SqDiz = {SqDiz1,SqDiz2,SqDiz3,SqDiz4};
% Initialize the Q-tables for each time period to 0.
Q1 = zeros(HS^0,A); % Q-table at t1.
Q2 = zeros(HS^1,A); % Q-table at t2.
Q3 = zeros(HS^2,A); % Q-table at t3.
Q4 = zeros(HS^3,A); % Q-table at t4.
Q = {Q1,Q2,Q3,Q4};
|