summaryrefslogtreecommitdiff
path: root/rand_pred.m
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2012-05-10 11:17:24 +0200
committerJan Klemkow <j.klemkow@wemelug.de>2012-05-10 11:17:24 +0200
commit031f9ecc989d177215bc85e1827cf1d72db07643 (patch)
tree79ec0f16eebd559efd9a20670181690144ab21d0 /rand_pred.m
parent280b2875e45d8cdf2de813a4bce53cc2d1870b04 (diff)
downloaddmc-031f9ecc989d177215bc85e1827cf1d72db07643.tar.gz
dmc-031f9ecc989d177215bc85e1827cf1d72db07643.tar.bz2
dmc-031f9ecc989d177215bc85e1827cf1d72db07643.zip
Add a method for random prediction.
This method show the distace from nonsence to the other methods. It uses the variance of each product for prediction.
Diffstat (limited to 'rand_pred.m')
-rw-r--r--rand_pred.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/rand_pred.m b/rand_pred.m
new file mode 100644
index 0000000..5ed4be3
--- /dev/null
+++ b/rand_pred.m
@@ -0,0 +1,8 @@
+function pred = rand_pred(data, times)
+
+ pred = abs(normrnd(mean(data), sqrt(var(data))));
+
+ for i = 1:(times-1)
+ pred = [ pred; abs(normrnd(mean(data), sqrt(var(data))))];
+ end
+end