summaryrefslogtreecommitdiff
path: root/regress_frequency_removal.m
blob: 742327edb8b852e64b5fdaff13ed83acaeeccbdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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, 1, @log);
	pred = fft(pred);
	%pred = (pred .* (removed == 0)) + removed;
	pred = pred + removed;
	pred = real(ifft(pred));
	pred = max(pred, 0);
endfunction