Replicating MATLAB, R, and Python codes