diff options
-rw-r--r-- | rand_pred.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rand_pred.m b/rand_pred.m index 2e38e80..2bca8b6 100644 --- a/rand_pred.m +++ b/rand_pred.m @@ -1,9 +1,9 @@ function pred = rand_pred(price, data) times = size(price, 1) - size(data, 1); - pred = abs(normrnd(mean(data), sqrt(var(data)))); + pred = zeros(times, 1); - for i = 1:(times-1) - pred = [ pred; abs(normrnd(mean(data), sqrt(var(data))))]; + for i = 1:times + pred(i) = abs(normrnd(mean(data), sqrt(var(data)))); end end |