function pred = regress_frequency_removal(price, quantity) assert(size(quantity, 1) >= 14); %test_count = size(quantity, 1); test_count = 14; test_set = 1:test_count; pred_set = size(quantity, 1)+1:size(price, 1); [q2, removed] = remove_sevenday_frequency(quantity(test_set, :)); pred = regress_pred(price([test_set pred_set],:), q2, @(x)x); pred = fft(pred); %pred = (pred .* (removed == 0)) + removed; pred = pred + removed; pred = real(ifft(pred)); endfunction