forked from bsouhaib/prob-hts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_basef.sh
More file actions
executable file
·28 lines (17 loc) · 767 Bytes
/
run_basef.sh
File metadata and controls
executable file
·28 lines (17 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#full_path=$(realpath $0)
full_path="YOUR/PATH/TO/run_basef.sh"
dir_path=$(dirname $full_path)
mypath=$(dirname $dir_path )
rscript="basef.R"
doagg=FALSE && tag="bottom" && algo="KD-IC-NML" && njobs=4 && nperjobs=395 # (bottom-level forecasts)
# doagg=TRUE && tag="agg" && algo="DETS" && njobs=28 && nperjobs=2 # (aggregate-level forecasts)
allijobs=$(seq 1 $njobs )
for ijob in ${allijobs[@]}
do
start=$(( 0 + ($ijob - 1)* ($nperjobs) + 1 ))
end=$(( 0 + ($ijob - 1)* ($nperjobs) + ($nperjobs) ))
alliseries=( $(seq $start $end ) )
echo "${alliseries[@]}"
Rscript --vanilla $rscript $algo $doagg ${alliseries[@]} > "$mypath/work/rout/basef-$tag-$algo-$ijob.Rout" 2> "$mypath/work/rout/basef-$tag-$algo-$ijob.err" &
done