summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2012-05-12 10:47:16 +0200
committerJan Klemkow <j.klemkow@wemelug.de>2012-05-12 10:47:16 +0200
commit3b0a343ff2cab08508c4718952ce0cb2b9df4fc8 (patch)
tree44569c4030fada175260ea3c98e9ba0c00c83ed6
parentf8308571ad5d3828c83e7cb6226429731cad883a (diff)
downloaddmc-3b0a343ff2cab08508c4718952ce0cb2b9df4fc8.tar.gz
dmc-3b0a343ff2cab08508c4718952ce0cb2b9df4fc8.tar.bz2
dmc-3b0a343ff2cab08508c4718952ce0cb2b9df4fc8.zip
chi_pred: add an inactive chi rand. pred method.
-rw-r--r--chi_pred.m9
-rw-r--r--run_tests.m3
2 files changed, 11 insertions, 1 deletions
diff --git a/chi_pred.m b/chi_pred.m
new file mode 100644
index 0000000..6e82d37
--- /dev/null
+++ b/chi_pred.m
@@ -0,0 +1,9 @@
+function pred = chi_pred(price, data)
+
+ times = size(price, 1) - size(data, 1);
+ pred = zeros(times, size(price, 2));
+
+ for i = 1:times
+ pred(i,:) = abs(chi2rnd(sqrt(var(data))));
+ end
+end
diff --git a/run_tests.m b/run_tests.m
index 4ab6922..12306a4 100644
--- a/run_tests.m
+++ b/run_tests.m
@@ -13,7 +13,8 @@ pred_methods = [
m('quad', @quad_regress_pred)
m('log reg.', @log_regress_pred)
m('sevenday', @sevenday_pred)
- m('random', @rand_pred)
+ m('norm rand.',@rand_pred)
+% m('chi rand.',@chi_pred)
m('regress2', @regress_frequency_removal)
];
num_methods = size(pred_methods, 1);