function [F, error_rate, diff_xhist] = split_classify(input_vec, method, split_point, analysis_window, do_plot); % split_classify( INPUT_VECTOR, METHOD, SPLIT_POINT, ANALYSIS_WINDOW, DO_PLOT); % % Trains on the first 1:SPLIT_POINT actions using history vectors of size % ANALYSIS_WINDOW+2 assuming that METHOD is the trial type that is being run. % Takes the following arguments: % % Required: % INPUT_VECTOR - The vector of choices given by the user (e.g. c1(:,1)') % % METHOD - Must be either 1, 2, or 3. Will specify the form of the reward % schedule presented under this trial % % SPLIT_POINT - Train on trials up to SPLIT_POINT and test/predict on trials % after SPLIT_POINT % % ANALYSIS_WINDOW - The size of the reward history to use. For example, % if we want to include the past three rewards in the history vector, % then ANALYSIS_WINDOW will be 3. % % DO_PLOT - Set this to 1 if you want to see the results of the model % trajectories plotted with the user history. Set to 0 if no plotting % output is desired. % % The output arguments are [F, ERROR_RATE, DIFF_XHIST]. F is the structure % containing the LDA parameters. ERROR_RATE is the classification error % rate, and DIFF_XHIST is the difference between model final allocation and % subject final allocation. % % Examples: % For the examples described in our project % % >> [F, error_rate, diff_xhist] = split_classify(c1(:,1)', 1, 120, 5, 0); if size(input_vec,2)