diff --git a/README.md b/README.md index 387b325..9b549ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,19 @@ -edtc-code -========= +Economic Dynamics, Theory and Computation +============================================ + +This is the code repository for the text [Economic Dynamics, Theory and Computation](http://johnstachurski.net/personal/edtc.html) by [John Stachurski](http://johnstachurski.net). + +### About + +This code repository is written in conjuction with the text [Economic +Dynamics, Theory and Computation](http://johnstachurski.net/personal/edtc.html). The Python code +contained in this repository is explained in detail in the text. The MATLAB +code provides equivalents to the Python code for those who prefer MATLAB. + +### Downloading the Repository + +Either + +* Click the 'Zip' button at the top of this page, or +* Use [Git](https://help.github.com) to clone the repository -Code for Economic Dynamics, Theory and Computation \ No newline at end of file diff --git a/edtc_matlab.zip b/edtc_matlab.zip deleted file mode 100644 index 821c98a..0000000 Binary files a/edtc_matlab.zip and /dev/null differ diff --git a/edtc_matlab/cpdynam.m b/edtc_matlab/cpdynam.m deleted file mode 100644 index 2b2b5d7..0000000 --- a/edtc_matlab/cpdynam.m +++ /dev/null @@ -1,76 +0,0 @@ -% Filename: cpdynam.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.7 - -% Note: All of the code is wrapped in a class definition so that it can -% be put in one file. See the comments in kurtzbellman.m. An example -% of usage is given below. - -classdef cpdynam < handle - properties - alpha = 0.8; - a = 5.0; - c = 2.0; - W; - D; - P; - end - - methods - function self = cpdynam - self.W = betarnd(5, 5, 1, 1000) * self.c + self.a; % Shock obs. - self.D = @(x) 1.0/x; % Demand curve - self.P = self.D; % Inverse of 1/x is just 1/x - end - - function fp = fix_point(self, h, lower, upper) - % Computes the fixed point of h on [upper,lower] using fzero, - % which finds the zeros (roots) of a univariate function. - % Parameters : h is a function and lower and upper are numbers - % (floats or integers). - fp = fzero(@(x) x - h(x), [lower, upper]); - end - - function t = T(self, p, x) - % Computes Tp(x), where T is the pricing functional operator. - % Parameters : p is an instance of lininterp and x is a number. - y = self.alpha * mean(p.interp(self.W)); - if y <= self.P(x) - t = self.P(x); - return; - end - h = @(r) self.alpha * +... - mean(p.interp(self.alpha * (x - self.D(r)) + self.W)); - t = self.fix_point(h, self.P(x), y); - end - end -end - -% The following test shows how to use the class. Put the code in a -% separate file, in the same directory as cpdynam.m and lininterp -% -% cp = cpdynam; -% gridsize = 150; -% grid = linspace(cp.a, 35, gridsize); -% tol = 0.0005; -% vals = zeros(1, gridsize); -% new_vals = zeros(1, gridsize); -% for i = 1:gridsize -% vals(i) = cp.P(grid(i)); -% end -% while 1 -% hold on; -% plot(grid, vals); -% p = lininterp(grid, vals); -% f = @(x) cp.T(p, x); -% for i = 1:gridsize -% new_vals(i) = f(grid(i)); -% end -% if max(abs(new_vals - vals)) < tol -% break -% end -% vals = new_vals; -% end -% hold off; - diff --git a/edtc_matlab/ds.m b/edtc_matlab/ds.m deleted file mode 100644 index 985c277..0000000 --- a/edtc_matlab/ds.m +++ /dev/null @@ -1,36 +0,0 @@ -% Filename: ds.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.2 - -classdef ds < handle - - properties - % h is a function and x is a number - % in S representing the current state . - h; - x; - end - - methods - function self = ds(h,x) - self.h = h; - self.x = x; - end - - function update(self) - % Update the state of the system by applying h. - self.x = self.h(self.x); - end - - function traj = trajectory(self,n) - % Generate a trajectory of length n, starting - % at the current state . - traj = zeros(1,n); - for i = 1:n - traj(i) = self.x; - self.update; - end - end - end -end diff --git a/edtc_matlab/edf.m b/edtc_matlab/edf.m deleted file mode 100644 index ff424c2..0000000 --- a/edtc_matlab/edf.m +++ /dev/null @@ -1,29 +0,0 @@ -% Filename: edf.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing xxxx -% Corresponds to Listing 6.3 in Economic Dynamics -% Author: Andy Qi, Kyoto University -% Date: Dec 22,2008 - -classdef edf - properties - observations; - end - - methods - function obj = edf(observations) - obj.observations = observations; - end - - function f = p(obj,x) - counter = 0; - for obs = obj.observations - if obs <= x - counter = counter + 1; - end - end - f = counter / length(obj.observations); - end - end -end diff --git a/edtc_matlab/fpi.m b/edtc_matlab/fpi.m deleted file mode 100644 index 1d53e22..0000000 --- a/edtc_matlab/fpi.m +++ /dev/null @@ -1,111 +0,0 @@ -% Filename: fpi.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.6 - -% Note: All of the code is wrapped in a class definition so that it can -% be put in one file. See the comments in kurtzbellman.m. An example -% of usage is given below. - -classdef fpi < handle - properties - theta = 0.5; - alpha = 0.8; - rho = 0.9; - W; - gridmax = 8; - gridsize = 150; - grid; - end - - methods - function self = fpi - self.W = exp(randn(1, 1000)); % Draws of shock - self.grid = linspace(0, self.gridmax^(1e-1), self.gridsize).^10; - end - - function u = U(self, c) - % Utility function - u = 1 - exp(- self.theta * c); - end - - function pro = f(self, k, z) - % Production function - pro = (k^self.alpha) * z; - end - - function max = maximizer(self, h, a, b) - max = fminbnd(@(x) -h(x), a, b); - end - - function t = T(self, sigma, w) - % Implements the operator L T_sigma - % Parameters: sigma and w should be instances of lininterp - len = self.gridsize; - vals = zeros(1, len); - for i = 1:len - x = self.grid(i); - Tw_y = self.U(x - sigma.interp(x)) + ... - self.rho * mean(w.interp(self.f(sigma.interp(x), self.W))); - vals(i) = Tw_y; - end - t = lininterp(self.grid, vals); - end - - function g = get_greedy(self, w) - % Computes a w-greedy policy, where w is an instance of lininterp - len = self.gridsize; - vals = zeros(1, len); - for i = 1:len - x = self.grid(i); - h = @(k) self.U(x - k) + ... - self.rho * mean(w.interp(self.f(k, self.W))); - vals(i) = self.maximizer(h, 0, x); - end - g = lininterp(self.grid, vals); - end - - function v = get_value(self, sigma, v) - % Computes an approximation to v_sigma, the value of following - % policy sigma. Function v is a guess of v_sigma. - % Parameters: sigma and v are both instances of lininterp - tol = 1e-2; % Error tolerance - while 1 - new_v = self.T(sigma, v); - err = max(abs(new_v.Y - v.Y)); - if err < tol - v = new_v; - return; - end - v = new_v; - end - end - end -end - -% The following test shows how to use the class. Put the code in a -% separate file, in the same directory as fpi.m and lininterp -% -% tol = 0.005; -% f = fpi; -% % Choose a guess of the optimal policy -% sigma = f.get_greedy(lininterp(f.grid, f.U(f.grid))); -% Compute v_sigma using U as a starting point for the interative -% procedure in get_value -% v = f.get_value(sigma, lininterp(f.grid, f.U(f.grid))); -% while 1 -% hold on; -% plot(f.grid, sigma.Y); -% sigma_new = f.get_greedy(v); -% % Compute v_sigma_new using v as a starting point for the iteration -% v_new = f.get_value(sigma_new, v); -% err = max(abs(v_new.Y - v.Y)); -% if err < tol -% break -% else -% v = v_new; -% sigma = sigma_new; -% end -% end -% hold off; - diff --git a/edtc_matlab/fvi.m b/edtc_matlab/fvi.m deleted file mode 100644 index 2dddf1d..0000000 --- a/edtc_matlab/fvi.m +++ /dev/null @@ -1,70 +0,0 @@ -% Filename: fvi.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.5 - -% Note: All of the code is wrapped in a class definition so that it can -% be put in one file. See the comments in kurtzbellman.m. An example -% of usage is given below. - -classdef fvi < handle - properties - theta = 0.5; - alpha = 0.8; - rho = 0.9; - W; - gridmax = 8; - gridsize = 150; - grid; - end - - methods - function self = fvi - self.W = exp(randn(1,1000)); % Draws of shock - self.grid = linspace(0,self.gridmax^(1e-1),self.gridsize).^10; - end - - function u = U(self,c) % Utility function - u = 1 - exp(- self.theta * c); - end - - function pro = f(self,k,z) % Production function - pro = (k^self.alpha) * z; - end - - function m = maximum(self,h,a,b) - m = h(fminbnd(@(x) -h(x),a,b)); - end - - function li = bellman(self,w) - % The approximate Bellman operator. - % Parameters : w is an instance of lininterp (see the file - % lininterp.m) - % Returns : An instance of lininterp - - len = length(self.grid); - vals = zeros(1,len); - for i = 1:len - y = self.grid(i); - h = @(k) U(self,(y - k)) +... - self.rho * mean(w.interp(f(self,k,self.W))); - vals(i) = self.maximum(h,0,y); - end - li = lininterp(self.grid,vals); - end - end -end - -% The following test shows how to use the class. Put the code in a -% separate file, in the same directory as fvi.m and lininterp -% -% f = fvi; -% v = lininterp(f.grid, f.U(f.grid)); -% -% for i = 1:10 -% hold on; -% plot(f.grid, v.Y); -% w = f.bellman(v); -% v = w; -% end -% hold off; diff --git a/edtc_matlab/kurtzbellman.m b/edtc_matlab/kurtzbellman.m deleted file mode 100644 index 68a2df5..0000000 --- a/edtc_matlab/kurtzbellman.m +++ /dev/null @@ -1,84 +0,0 @@ -% Filename: kurtzbellman.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 5.1 - -% The MATLAB code for this listing is put in a class definition -% because MATLAB can only have one function or class definition -% per file. By putting the code in a class definition, we can -% have all the code in one file. At the bottom of the file is -% a test of the code which shows how to use the class. - -classdef kurtzbellman < handle - properties - beta = 0.5; - rho = 0.9; - B = 10; - M = 5; - S; % State space = 0,...,B + M - Z; % Shock space = 0,...,B - end - - methods - function self = kurtzbellman - self.S = 0:(self.B + self.M); - self.Z = 0:self.B; - end - - function u = U(self,c) - % Utility function - u = c^self.beta; - end - - function p = phi(self,z) - % Probability mass function,uniform distribution - if 0 <= z && z <= self.B - p = 1.0 / length(self.Z); - else - p = 0; - end - end - - function g = Gamma(self,x) - % The correspondence of feasible actions . - g = 0:min(x,self.M); - end - - function Tv = T(self,v) - % An implementation of the Bellman operator. - % Parameters: v is a sequence representing a - % function defined on S. Returns: Tv,a list. - Tv = zeros(1,length(self.S)); - for x = self.S - % Compute the value of the objective function for each - % a in Gamma (x), and store the result in vals - vals = zeros(1,length(Gamma(self,x))); - for a = Gamma(self,x) - Sum = 0; - for z = self.Z - Sum = Sum + v(a + z + 1) * self.phi(z); - end - y = U(self,(x - a)) + self.rho * Sum; - vals(a + 1) = y; - end - Tv(x + 1) = max(vals); - end - end - end -end - -% The following test shows how to use the class. Put the code in a -% separate file, in the same directory as kurtzbellman.m -% -% kb = kurtzbellman; -% w = zeros(1, length(kb.S)); -% err = 1; -% while err > 0.001 -% v = kb.T(w); -% err = max(abs(v - w)); -% w = v; -% hold on; -% plot(w); -% end -% hold off; - diff --git a/edtc_matlab/kurtzvsigma.m b/edtc_matlab/kurtzvsigma.m deleted file mode 100644 index 8ef490e..0000000 --- a/edtc_matlab/kurtzvsigma.m +++ /dev/null @@ -1,45 +0,0 @@ -% Filename: kurtzvsigma.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 5.2 - -% Note: See the comments below for an example of usage. - -function v_sigma = kurtzvsigma(kb,sigma) - % Computes the value of following policy sigma. Here kb - % is an instance of the class kurtzbellman, as defined in - % kurtzbellman.m - - % Set up the stochastic kernel p_sigma as a 2D array : - len = length(kb.S); - p_sigma = zeros(len,len); - for x = kb.S - for y = kb.S - p_sigma(x + 1,y + 1) = phi(kb,(y - sigma(x + 1))); - end - end - % Create the right Markov operator M_sigma : - M_sigma = @(h)p_sigma * h; - - % Set up the function r_sigma as an array : - % Initialize r_sigma into a column vector - r_sigma = zeros(len,1); - for x = kb.S - r_sigma(x + 1) = U(kb,(x - sigma(x + 1))); - end - v_sigma = zeros(len,1); - discount = 1; - for i = 1:50 - v_sigma = v_sigma + discount * r_sigma; - r_sigma = M_sigma(r_sigma); - discount = discount * kb.rho; - end -end - -% Example of usage (put this in a separate file in the same -% directory as kurtzbellman.m and kurtzvsigma.m -% -% BO = kurtzbellman; -% m = ones(1, 16); -% kurtzvsigma(BO, m) - diff --git a/edtc_matlab/lininterp.m b/edtc_matlab/lininterp.m deleted file mode 100644 index cd429ae..0000000 --- a/edtc_matlab/lininterp.m +++ /dev/null @@ -1,32 +0,0 @@ -% Filename: lininterp.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.4 - -classdef lininterp - % Provides linear interpolation in one dimension - properties - % Parameters : X and Y are sequences or arrays - % containing the (x,y) interpolation points - X; - Y; - end - methods - function self = lininterp(x,y) - self.X = x; - self.Y = y; - end - - function i = interp(self,z) - % Uses MATLAB's interp1 function for interpolation. - % The z values are truncated so that they lie inside - % the grid points. The effect is that evaluation of - % a point to the left of X(1) returns Y(1), while - % evaluation of a point to the right of X(end) returns - % Y(end) - z = max(z, self.X(1)); - z = min(z, self.X(end)); - i = interp1(self.X, self.Y, z); - end - end -end diff --git a/edtc_matlab/mc.m b/edtc_matlab/mc.m deleted file mode 100644 index 3d6730a..0000000 --- a/edtc_matlab/mc.m +++ /dev/null @@ -1,43 +0,0 @@ -% Filename: mc.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.4 - -classdef mc < handle - - properties - % p[x] is a sequence - % of length N for each x, and represents p(x,dy). - % The parameter X is an integer in S. - p; - X; - end - - methods - function self = mc(p,X) - % Create an instance with stochastic kernel - % p and current state X.Here p[x] is an array of length N - % for each x, and represents p(x,dy). - % The parameter X is an integer in S. - self.p = p; - self.X = X; - end - - function update(self) - % Update the state by drawing from p(X,dy). - px = self.p((self.X),:); - len = length(px); - self.X = randsample(1:len,1,true,px); - end - - function path = sample_path(self,n) - % Generate a sample path of length n, starting - % from the current state . - path = zeros(1,n); - for i = 1:n - path(i) = self.X; - self.update; - end - end - end -end diff --git a/edtc_matlab/p2srs.m b/edtc_matlab/p2srs.m deleted file mode 100644 index c7306b3..0000000 --- a/edtc_matlab/p2srs.m +++ /dev/null @@ -1,34 +0,0 @@ -% Filename: p2srs.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 5.3 - -% Note: The code below gives an example of usage - -function r = p2srs(p) - % Takes a kernel p on S = {1,...,N} and returns a function - % F(x,z) which represents it as an SRS. - % Parameters : p is a matrix - % Returns : A function F with arguments (x,z). - S = 1:length(p(1,:)); - function f = F(x,z) - a = 0; - for y = S - if a < z && z <= a + p(x,y) - f = y; - return; - end - a = a + p(x,y); - end - end - r = @F; -end - -% Example of usage (put this in a separate file in the same directory). -% -% -% pH = [0.971,0.029,0.000; -% 0.145,0.778,0.077; -% 0.000,0.508,0.492]; -% F = p2srs(pH); -% F(2, 0.7) % should return 2 diff --git a/edtc_matlab/polyclass.m b/edtc_matlab/polyclass.m deleted file mode 100644 index bfaac91..0000000 --- a/edtc_matlab/polyclass.m +++ /dev/null @@ -1,36 +0,0 @@ -% Filename: polyclass.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 2.2 - -classdef polyclass - properties - coef; - end - - methods - function self = polyclass(coef) - % Creates an instance p of the Polynomial class, - % where p(x) = coef[0] x^0 + ... + coef[N] x^N. - self.coef = coef; - end - - function y = evaluate(self,x) - % Reverse the order of coef, and then use MATLAB's - % polyval function to evaluate - y = polyval(self.coef(end:-1:1),x); - end - - function self = differentiate(self) - len = length(self.coef); - new_coef = zeros(1,len); - for i = 1:len - new_coef(i) = (i-1) * self.coef(i); - end - % Remove the first element, which is zero - new_coef(1) = []; - % And reset coefficients data to new values - self.coef = new_coef; - end - end -end diff --git a/edtc_matlab/srs.m b/edtc_matlab/srs.m deleted file mode 100644 index 5e539c2..0000000 --- a/edtc_matlab/srs.m +++ /dev/null @@ -1,38 +0,0 @@ -% Filename: srs.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.1 - -classdef srs < handle - properties - % Parameters : F and phi are functions, where - % phi() returns a draw from phi. X is a - % number representing the initial condition - F; - phi; - X; - end - - methods - function self = srs(F,phi,X) - % Represents X_{t + 1} = F(X_t,W_{t + 1}); W ~ phi - self.F = F; - self.phi = phi; - self.X = X; - end - - function update(self) - % Update the state according to X = F(X, W) - self.X = self.F(self.X,self.phi()); - end - - function path = sample_path(self,n) - % Generate path of length n from current state - path = zeros(1,n); - for i = 1:n - path(i) = self.X; - self.update; - end - end - end -end diff --git a/edtc_matlab/testds.m b/edtc_matlab/testds.m deleted file mode 100644 index e7d34d0..0000000 --- a/edtc_matlab/testds.m +++ /dev/null @@ -1,11 +0,0 @@ -% Filename: testds.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.3 - -quadmap = @(x)4 * x * (1 - x); -q = ds(quadmap,0.1); % Create an instance q of ds -T1 = q.trajectory(100); % T1 holds trajectory from 0.1 - -q.x = 0.2; % Reset current state to 0.2 -T2 = q.trajectory(100); % T2 holds trajectory from 0.2 diff --git a/edtc_matlab/testmc.m b/edtc_matlab/testmc.m deleted file mode 100644 index 856bb8d..0000000 --- a/edtc_matlab/testmc.m +++ /dev/null @@ -1,21 +0,0 @@ -% Filename: testmc.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.5 - -pH = [0.971,0.029,0.000; - 0.145,0.778,0.077; - 0.000,0.508,0.492]; - -psi = [0.3,0.4,0.3]; % Initial condition -len = length(psi); -rs = randsample(1:len,1,true,psi); % Use randsample fuction returns i with - % probability phi[i], where phi is a - % sequence -h = mc(pH,rs); % Create an instance of class mc -T1 = sample_path(h,1000); % Series is Markov -(p, psi) - -psi2 = [0.8,0.1,0.1]; % Alternative initial cond. -len2 = length(psi2); -h.X = randsample(1:len2,1,true,psi2); % Reset the current state -T2 = sample_path(h,1000); % Series is Markov -(p, psi2) diff --git a/edtc_matlab/testsrs.m b/edtc_matlab/testsrs.m deleted file mode 100644 index b9b5b4d..0000000 --- a/edtc_matlab/testsrs.m +++ /dev/null @@ -1,17 +0,0 @@ -% Filename: testsrs.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 6.2 - -alpha = 0.5; -sigma = 0.2; -s = 0.5; -delta = 0.1; -% Define F(k, z) = s * k ^ alpha * z + (1 - delta ) * k -F = @(k,z) s * (k^alpha) * z + (1 - delta) * k; -lognorm = @() lognrnd(0,sigma); - -solow_srs = srs(F,lognorm,1.0); -P1 = sample_path(solow_srs,500); % Generate Path from X = 1 -solow_srs.X = 60; % Reset the current state -P2 = sample_path(solow_srs,500); % Generate Path from X = 60 diff --git a/edtc_matlab_rev/ar1.m b/edtc_matlab_rev/ar1.m deleted file mode 100644 index bce6d6e..0000000 --- a/edtc_matlab_rev/ar1.m +++ /dev/null @@ -1,12 +0,0 @@ -% Filename: ar1.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 8.1 - -a = 0.5; -b = 1; -X = zeros(1, 101); % Create an empty array to store path -X(1) = normrnd(0, 1); % X_0 has dist N(0, 1) -for t = 1:100 - X(t + 1) = normrnd(a * X(t) + b, 1); -end diff --git a/edtc_matlab_rev/ecdf.m b/edtc_matlab_rev/ecdf.m deleted file mode 100644 index dcd580f..0000000 --- a/edtc_matlab_rev/ecdf.m +++ /dev/null @@ -1,2 +0,0 @@ - -% Please use the MATLAB built in ecdf function diff --git a/edtc_matlab_rev/fphamilton.m b/edtc_matlab_rev/fphamilton.m deleted file mode 100644 index 79850cf..0000000 --- a/edtc_matlab_rev/fphamilton.m +++ /dev/null @@ -1,13 +0,0 @@ -% Filename: fphamilton.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.6 - -pH = [0.971,0.029,0.000; % Hamilton's kernel - 0.145,0.778,0.077; - 0.000,0.508,0.492]; -I = eye(3); % 3 by 3 identity matrix -Q = ones(3); % Matrix of ones -b = ones(3,1); % Vector of ones -A = transpose(I - pH + Q); -solution = A \ b; diff --git a/edtc_matlab_rev/polyclass0.m b/edtc_matlab_rev/polyclass0.m deleted file mode 100644 index 5f0572c..0000000 --- a/edtc_matlab_rev/polyclass0.m +++ /dev/null @@ -1,7 +0,0 @@ - -% Filename: polyclass0.m -% -% The MATLAB version of the Python code in polyclass0.py is omitted, since -% polyclass0.py is not real Python, but rather for illustration purposes -% only. Please see polyclass.m -% diff --git a/edtc_matlab_rev/quadmap1.m b/edtc_matlab_rev/quadmap1.m deleted file mode 100644 index d5f72d0..0000000 --- a/edtc_matlab_rev/quadmap1.m +++ /dev/null @@ -1,12 +0,0 @@ -% Filename: quadmap1.m -% Author: Andy Qi -% Date: December 2008 -% Corresponds to: Listing 4.1 - -datapoints = zeros(1,200); -x = 0.11; -for t = 1:200 - datapoints(t) = x; - x = 4 * x * (1-x); -end -plot(datapoints) diff --git a/edtc_python.zip b/edtc_python.zip deleted file mode 100644 index f25cb15..0000000 Binary files a/edtc_python.zip and /dev/null differ diff --git a/edtc_matlab_rev/README.txt b/matlab_code/README.txt similarity index 100% rename from edtc_matlab_rev/README.txt rename to matlab_code/README.txt diff --git a/edtc_matlab/ar1.m b/matlab_code/ar1.m similarity index 100% rename from edtc_matlab/ar1.m rename to matlab_code/ar1.m diff --git a/edtc_matlab_rev/cpdynam_rev1/README.txt b/matlab_code/cpdynam_rev1/README.txt similarity index 100% rename from edtc_matlab_rev/cpdynam_rev1/README.txt rename to matlab_code/cpdynam_rev1/README.txt diff --git a/edtc_matlab_rev/cpdynam_rev1/T.m b/matlab_code/cpdynam_rev1/T.m similarity index 100% rename from edtc_matlab_rev/cpdynam_rev1/T.m rename to matlab_code/cpdynam_rev1/T.m diff --git a/edtc_matlab_rev/cpdynam_rev1/cpdynam_rev1.m b/matlab_code/cpdynam_rev1/cpdynam_rev1.m similarity index 100% rename from edtc_matlab_rev/cpdynam_rev1/cpdynam_rev1.m rename to matlab_code/cpdynam_rev1/cpdynam_rev1.m diff --git a/edtc_matlab_rev/cpdynam_rev1/fix_point.m b/matlab_code/cpdynam_rev1/fix_point.m similarity index 100% rename from edtc_matlab_rev/cpdynam_rev1/fix_point.m rename to matlab_code/cpdynam_rev1/fix_point.m diff --git a/edtc_matlab_rev/cpdynam_rev1/lininterp_rev1.m b/matlab_code/cpdynam_rev1/lininterp_rev1.m similarity index 100% rename from edtc_matlab_rev/cpdynam_rev1/lininterp_rev1.m rename to matlab_code/cpdynam_rev1/lininterp_rev1.m diff --git a/edtc_matlab_rev/ds_rev1.m b/matlab_code/ds_rev1.m similarity index 100% rename from edtc_matlab_rev/ds_rev1.m rename to matlab_code/ds_rev1.m diff --git a/edtc_matlab/ecdf.m b/matlab_code/ecdf.m similarity index 100% rename from edtc_matlab/ecdf.m rename to matlab_code/ecdf.m diff --git a/edtc_matlab/fphamilton.m b/matlab_code/fphamilton.m similarity index 100% rename from edtc_matlab/fphamilton.m rename to matlab_code/fphamilton.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/README.txt b/matlab_code/fvi_rev1_and_fpi_rev1/README.txt similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/README.txt rename to matlab_code/fvi_rev1_and_fpi_rev1/README.txt diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/T.m b/matlab_code/fvi_rev1_and_fpi_rev1/T.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/T.m rename to matlab_code/fvi_rev1_and_fpi_rev1/T.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/U.m b/matlab_code/fvi_rev1_and_fpi_rev1/U.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/U.m rename to matlab_code/fvi_rev1_and_fpi_rev1/U.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/bellman.m b/matlab_code/fvi_rev1_and_fpi_rev1/bellman.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/bellman.m rename to matlab_code/fvi_rev1_and_fpi_rev1/bellman.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/f.m b/matlab_code/fvi_rev1_and_fpi_rev1/f.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/f.m rename to matlab_code/fvi_rev1_and_fpi_rev1/f.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/get_greedy.m b/matlab_code/fvi_rev1_and_fpi_rev1/get_greedy.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/get_greedy.m rename to matlab_code/fvi_rev1_and_fpi_rev1/get_greedy.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/get_value.m b/matlab_code/fvi_rev1_and_fpi_rev1/get_value.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/get_value.m rename to matlab_code/fvi_rev1_and_fpi_rev1/get_value.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/lininterp_rev1.m b/matlab_code/fvi_rev1_and_fpi_rev1/lininterp_rev1.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/lininterp_rev1.m rename to matlab_code/fvi_rev1_and_fpi_rev1/lininterp_rev1.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/maximizer.m b/matlab_code/fvi_rev1_and_fpi_rev1/maximizer.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/maximizer.m rename to matlab_code/fvi_rev1_and_fpi_rev1/maximizer.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/maximum.m b/matlab_code/fvi_rev1_and_fpi_rev1/maximum.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/maximum.m rename to matlab_code/fvi_rev1_and_fpi_rev1/maximum.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/test_fpi_rev1.m b/matlab_code/fvi_rev1_and_fpi_rev1/test_fpi_rev1.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/test_fpi_rev1.m rename to matlab_code/fvi_rev1_and_fpi_rev1/test_fpi_rev1.m diff --git a/edtc_matlab_rev/fvi_rev1_and_fpi_rev1/test_fvi_rev1.m b/matlab_code/fvi_rev1_and_fpi_rev1/test_fvi_rev1.m similarity index 100% rename from edtc_matlab_rev/fvi_rev1_and_fpi_rev1/test_fvi_rev1.m rename to matlab_code/fvi_rev1_and_fpi_rev1/test_fvi_rev1.m diff --git a/edtc_matlab_rev/genfinitemc_rev1.m b/matlab_code/genfinitemc_rev1.m similarity index 100% rename from edtc_matlab_rev/genfinitemc_rev1.m rename to matlab_code/genfinitemc_rev1.m diff --git a/edtc_matlab_rev/kurtzbellman_rev1/Gamma.m b/matlab_code/kurtzbellman_rev1/Gamma.m similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/Gamma.m rename to matlab_code/kurtzbellman_rev1/Gamma.m diff --git a/edtc_matlab_rev/kurtzbellman_rev1/README.txt b/matlab_code/kurtzbellman_rev1/README.txt similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/README.txt rename to matlab_code/kurtzbellman_rev1/README.txt diff --git a/edtc_matlab_rev/kurtzbellman_rev1/T.m b/matlab_code/kurtzbellman_rev1/T.m similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/T.m rename to matlab_code/kurtzbellman_rev1/T.m diff --git a/edtc_matlab_rev/kurtzbellman_rev1/U.m b/matlab_code/kurtzbellman_rev1/U.m similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/U.m rename to matlab_code/kurtzbellman_rev1/U.m diff --git a/edtc_matlab_rev/kurtzbellman_rev1/kurtzbellman_rev1_test.m b/matlab_code/kurtzbellman_rev1/kurtzbellman_rev1_test.m similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/kurtzbellman_rev1_test.m rename to matlab_code/kurtzbellman_rev1/kurtzbellman_rev1_test.m diff --git a/edtc_matlab_rev/kurtzbellman_rev1/phi.m b/matlab_code/kurtzbellman_rev1/phi.m similarity index 100% rename from edtc_matlab_rev/kurtzbellman_rev1/phi.m rename to matlab_code/kurtzbellman_rev1/phi.m diff --git a/edtc_matlab_rev/kurtzsigma_rev1/README.txt b/matlab_code/kurtzsigma_rev1/README.txt similarity index 100% rename from edtc_matlab_rev/kurtzsigma_rev1/README.txt rename to matlab_code/kurtzsigma_rev1/README.txt diff --git a/edtc_matlab_rev/kurtzsigma_rev1/U.m b/matlab_code/kurtzsigma_rev1/U.m similarity index 100% rename from edtc_matlab_rev/kurtzsigma_rev1/U.m rename to matlab_code/kurtzsigma_rev1/U.m diff --git a/edtc_matlab_rev/kurtzsigma_rev1/kurtzsigma_rev1_test.m b/matlab_code/kurtzsigma_rev1/kurtzsigma_rev1_test.m similarity index 100% rename from edtc_matlab_rev/kurtzsigma_rev1/kurtzsigma_rev1_test.m rename to matlab_code/kurtzsigma_rev1/kurtzsigma_rev1_test.m diff --git a/edtc_matlab_rev/kurtzsigma_rev1/kurtzvsigma_rev1.m b/matlab_code/kurtzsigma_rev1/kurtzvsigma_rev1.m similarity index 100% rename from edtc_matlab_rev/kurtzsigma_rev1/kurtzvsigma_rev1.m rename to matlab_code/kurtzsigma_rev1/kurtzvsigma_rev1.m diff --git a/edtc_matlab_rev/kurtzsigma_rev1/phi.m b/matlab_code/kurtzsigma_rev1/phi.m similarity index 100% rename from edtc_matlab_rev/kurtzsigma_rev1/phi.m rename to matlab_code/kurtzsigma_rev1/phi.m diff --git a/edtc_matlab_rev/lininterp_rev1.m b/matlab_code/lininterp_rev1.m similarity index 100% rename from edtc_matlab_rev/lininterp_rev1.m rename to matlab_code/lininterp_rev1.m diff --git a/edtc_matlab_rev/p2srs_rev1.m b/matlab_code/p2srs_rev1.m similarity index 100% rename from edtc_matlab_rev/p2srs_rev1.m rename to matlab_code/p2srs_rev1.m diff --git a/edtc_matlab/polyclass0.m b/matlab_code/polyclass0.m similarity index 100% rename from edtc_matlab/polyclass0.m rename to matlab_code/polyclass0.m diff --git a/edtc_matlab/quadmap1.m b/matlab_code/quadmap1.m similarity index 100% rename from edtc_matlab/quadmap1.m rename to matlab_code/quadmap1.m diff --git a/edtc_matlab_rev/srs_testrs/README.txt b/matlab_code/srs_testrs/README.txt similarity index 100% rename from edtc_matlab_rev/srs_testrs/README.txt rename to matlab_code/srs_testrs/README.txt diff --git a/edtc_matlab_rev/srs_testrs/sample_path.m b/matlab_code/srs_testrs/sample_path.m similarity index 100% rename from edtc_matlab_rev/srs_testrs/sample_path.m rename to matlab_code/srs_testrs/sample_path.m diff --git a/edtc_matlab_rev/srs_testrs/testsrs_rev1.m b/matlab_code/srs_testrs/testsrs_rev1.m similarity index 100% rename from edtc_matlab_rev/srs_testrs/testsrs_rev1.m rename to matlab_code/srs_testrs/testsrs_rev1.m diff --git a/edtc_matlab_rev/srs_testrs/update.m b/matlab_code/srs_testrs/update.m similarity index 100% rename from edtc_matlab_rev/srs_testrs/update.m rename to matlab_code/srs_testrs/update.m diff --git a/edtc_matlab_rev/testds_rev1.m b/matlab_code/testds_rev1.m similarity index 100% rename from edtc_matlab_rev/testds_rev1.m rename to matlab_code/testds_rev1.m diff --git a/edtc_matlab_rev/testgenfinitemc_rev1.m b/matlab_code/testgenfinitemc_rev1.m similarity index 100% rename from edtc_matlab_rev/testgenfinitemc_rev1.m rename to matlab_code/testgenfinitemc_rev1.m diff --git a/edtc_python/ar1.py b/python_code/ar1.py similarity index 100% rename from edtc_python/ar1.py rename to python_code/ar1.py diff --git a/edtc_python/cpdynam.py b/python_code/cpdynam.py similarity index 100% rename from edtc_python/cpdynam.py rename to python_code/cpdynam.py diff --git a/edtc_python/ds.py b/python_code/ds.py similarity index 100% rename from edtc_python/ds.py rename to python_code/ds.py diff --git a/edtc_python/ecdf.py b/python_code/ecdf.py similarity index 100% rename from edtc_python/ecdf.py rename to python_code/ecdf.py diff --git a/edtc_python/fig1point2.py b/python_code/fig1point2.py similarity index 100% rename from edtc_python/fig1point2.py rename to python_code/fig1point2.py diff --git a/edtc_python/fig1point4.py b/python_code/fig1point4.py similarity index 100% rename from edtc_python/fig1point4.py rename to python_code/fig1point4.py diff --git a/edtc_python/fig1point5.py b/python_code/fig1point5.py similarity index 100% rename from edtc_python/fig1point5.py rename to python_code/fig1point5.py diff --git a/edtc_python/fig4point1.py b/python_code/fig4point1.py similarity index 100% rename from edtc_python/fig4point1.py rename to python_code/fig4point1.py diff --git a/edtc_python/fig4point3.py b/python_code/fig4point3.py similarity index 100% rename from edtc_python/fig4point3.py rename to python_code/fig4point3.py diff --git a/edtc_python/fig4point6.py b/python_code/fig4point6.py similarity index 100% rename from edtc_python/fig4point6.py rename to python_code/fig4point6.py diff --git a/edtc_python/fig4point7.py b/python_code/fig4point7.py similarity index 100% rename from edtc_python/fig4point7.py rename to python_code/fig4point7.py diff --git a/edtc_python/fig6point13.py b/python_code/fig6point13.py similarity index 100% rename from edtc_python/fig6point13.py rename to python_code/fig6point13.py diff --git a/edtc_python/fig6point4.py b/python_code/fig6point4.py similarity index 100% rename from edtc_python/fig6point4.py rename to python_code/fig6point4.py diff --git a/edtc_python/fphamilton.py b/python_code/fphamilton.py similarity index 100% rename from edtc_python/fphamilton.py rename to python_code/fphamilton.py diff --git a/edtc_python/fpi.py b/python_code/fpi.py similarity index 100% rename from edtc_python/fpi.py rename to python_code/fpi.py diff --git a/edtc_python/fvi.py b/python_code/fvi.py similarity index 100% rename from edtc_python/fvi.py rename to python_code/fvi.py diff --git a/edtc_python/genfinitemc.py b/python_code/genfinitemc.py similarity index 100% rename from edtc_python/genfinitemc.py rename to python_code/genfinitemc.py diff --git a/edtc_python/kurtzbellman.py b/python_code/kurtzbellman.py similarity index 100% rename from edtc_python/kurtzbellman.py rename to python_code/kurtzbellman.py diff --git a/edtc_python/kurtzvsigma.py b/python_code/kurtzvsigma.py similarity index 100% rename from edtc_python/kurtzvsigma.py rename to python_code/kurtzvsigma.py diff --git a/edtc_python/lininterp.py b/python_code/lininterp.py similarity index 100% rename from edtc_python/lininterp.py rename to python_code/lininterp.py diff --git a/edtc_python/p2srs.py b/python_code/p2srs.py similarity index 100% rename from edtc_python/p2srs.py rename to python_code/p2srs.py diff --git a/edtc_python/polyclass.py b/python_code/polyclass.py similarity index 100% rename from edtc_python/polyclass.py rename to python_code/polyclass.py diff --git a/edtc_python/polyclass0.py b/python_code/polyclass0.py similarity index 100% rename from edtc_python/polyclass0.py rename to python_code/polyclass0.py diff --git a/edtc_python/quadmap1.py b/python_code/quadmap1.py similarity index 100% rename from edtc_python/quadmap1.py rename to python_code/quadmap1.py diff --git a/edtc_python/srs.py b/python_code/srs.py similarity index 100% rename from edtc_python/srs.py rename to python_code/srs.py diff --git a/edtc_python/testds.py b/python_code/testds.py similarity index 100% rename from edtc_python/testds.py rename to python_code/testds.py diff --git a/edtc_python/testfpi.py b/python_code/testfpi.py similarity index 100% rename from edtc_python/testfpi.py rename to python_code/testfpi.py diff --git a/edtc_python/testgenfinitemc.py b/python_code/testgenfinitemc.py similarity index 100% rename from edtc_python/testgenfinitemc.py rename to python_code/testgenfinitemc.py diff --git a/edtc_python/testsrs.py b/python_code/testsrs.py similarity index 100% rename from edtc_python/testsrs.py rename to python_code/testsrs.py