# Last edited on 2014-06-15 19:48:01 by stolfilocal CHINESE SLUMBER METHOD # The "Chinese Slumber Method" looks at the Huobi mean hourly price {(L+H)/2} # at the "Slumber Times", 19:00--19:59 UTC every day. It tries to fit # trends to such "Slumber Points" and use those trends to predict the # price at the next future Slumber Time. # Each Slumber Point gets a /Slumber Activity Coefficient/ {S = Vh/Vd}, where # {Vh} is some average of the hourly trade volumes around around the Slumber Time, # and {Vd} is the total trade volume in that day. Each Slumber Point also gets # a /weight/ {W} that is a Gaussian bell function of {S/Sref} where {Sref} is {0.005}; # so that the weight is maximum ({W=1}) when there is no volume around the Slumber Time, # and quickle decays to zero when {S} grows beyond {Sref}. The weights are used # to fit the trends to points using weighted least squares, and to help decide whether # a Sumber Point is an outlier, or a break/gap in the trend. SLUMBER PREDICTION PLOTS # To apply the method, Huobi and Bitstamp price charts are captured from Bitcoinwisdom.com # After hand trimming, they are processed by the script "${date}-prediction-check-annotate.sh". # That script depends on a dozen parameters that must be captured by hand from the cropped plots. # such as the vertical and horizontal scales, the vertical positions of icons and labels, # the current set of trends and the past and current predictions. # The script reads the Slumber Points parameters (time, price, {S} and {W}) from the # file "../00-DATA/2014-slumber-points-HUBI-BSTP.txt". This file too must be updated # manually every day with data captured by hand from the Bitcoinwisdom charts. # The script also patches the Huobi charts to account for data that is missing because of long # Huobi outages, e.g. 3 hours in 2014-03-23. SCATTERPLOT OF VOLUMES FOR INLIER/OUTLIER SEPARATION # Created a file "analysis/2014-03-15-slumber-weights.txt" with the # hourly Huobi volumes {Vh0,Vh1,Vh2} at the slumber hours 18:00--20:59 # UTC (02:00--04:59 CST), the daily volumes {Vd} at 00:00--23:59 UTC, # and a hand-assigned quality indicator {QL}. Time span is determined by data available. dfile="analysis/2014-03-15-slumber-weights.txt" # Plotting scatterplots of volume/volume: for k in 0 1 2 3 ; do # for k in 3 ; do wh0=0.000; wh1=0.000; wh2=0.000 if [[ ${k} -eq 0 ]]; then wh0=1.00 ; refS=10.0 ; fi if [[ ${k} -eq 1 ]]; then wh1=1.00 ; refS=7.5 ; fi if [[ ${k} -eq 2 ]]; then wh2=1.00 ; refS=5.0 ; fi if [[ ${k} -eq 3 ]]; then wh0=0.053; wh1=0.690; wh2=0.071; refS=5.0 ; fi plot_slumber_volumes_scatter.sh \ "Huobi" \ ${wh0} ${wh1} ${wh2} ${refS} \ ${dfile} \ > 2014-03-15-slumber-volumes-scatter-${k}-HUBI.png done FITTING WEIGHTS TO DETECT GOOD SLUMBER POINTS # Extracting the ratios {Vh1/Vd}, {Vh2/Vd}, {Vh3/Vd} # and fitting them to the indicator {QL}. cat ${dfile} \ | gawk \ ' BEGIN { refS0 = 10.0; refS1 = 7.5; refS2 = 5.0; } /^[ ]*20[01][0-9][-]/ { d = $4; QL = $6; Vh0 = $8; Vh1 = $10; Vh2 = $12; Vd = $14; w0 = weight(Vh0,Vd,refS0); w1 = weight(Vh1,Vd,refS1); w2 = weight(Vh2,Vd,refS2); printf "%3d %8.4f %8.4f %8.4f %8.4f %8.4f\n", d, QL, 1.0, w0, w1, w2; } function weight(Vh,Vd,refS, z) { z = (Vh/Vd)/refS; return (z > 100 ? 0.0 : exp(-z)); } ' \ > .temp cat .temp | linear_fit -terms 4 PLOTTING PRICES AT SLUMBER POINTS plot_slumber_hourly_vol_ratios.sh \ "Huobi" \ ../00-DATA/2014-slumber-points-HUBI-BSTP.txt \ > 2014-03-14-slumber-points-HUBI-vr.png plot_slumber_rel_volumes.sh \ "Huobi" \ 0.053 0.690 0.071 5.00 \ ../00-DATA/2014-slumber-points-HUBI-BSTP.txt \ > 2014-03-14-slumber-points-HUBI-vm.png plot_slumber_prices.sh \ "Huobi" \ 2100 5400 0.000 \ ../00-DATA/2014-slumber-points-HUBI-BSTP.txt \ > 2014-slumber-points-HUBI-pr.png convert 2014-slumber-points-HUBI-pr.png -resize '600x' 2014-slumber-points-HUBI-pr.jpg plot_slumber_prices.sh \ "Huobi" \ 2100 5400 1.000 \ ../00-DATA/2014-slumber-points-HUBI-BSTP.txt \ > 2014-slumber-points-HUBI-pn.png PLOTTING PRICE RATIOS AT SLUMBER POINTS for ptsize in "volume" "weight" ; do pname="`yyyy-mm-dd`-slumber-points-HUBI-BSTP-ratio-${ptsize}" plot_slumber_prices_ratio.sh \ "Ratios of mean prices at slumber times (19:00--19:59 UTC)" \ 5.40 6.90 "${ptsize}" \ ../00-DATA/2014-slumber-points-HUBI-BSTP.txt \ > ${pname}.png convert ${pname}.png -resize '600x' -quality 80 ${pname}.jpg done FITTING LINE TO SLUMBER POINTS # Prepared files with lines "{I} {HUBI[I]} 1 {I}" for least squares fitting of slumber points: # Various linear trends cat 2014-01-10--2014-02-17-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-15--2014-02-18-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-10--2014-02-19-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-10--2014-02-18-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-18--2014-02-23-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-23--2014-02-25-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-02-27--2014-03-02-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-04--2014-03-05-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-07--2014-03-08-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-04--2014-03-08-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-08--2014-03-09-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-04--2014-03-09-slumber-trend.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 cat 2014-03-16--2014-03-17-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 # Shifted decaying exponential trends cat 2014-02-06--2014-02-09-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 4375.79*X[0] + 404.03*X[1] + 3.34*RND() cat 2014-02-10--2014-02-18-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 1 3900.69*X[0] + 200.33*X[1] + 49.30*RND() cat 2014-02-21--2014-02-27-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 3911.30*X[0] + 203.24*X[1] + 50.56*RND() cat 2014-02-21--2014-02-27-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 3542.48*X[0] - 22.76*X[1] + 117.11*RND() # The last one can be approximated by a horizontal straight line p = 3533.40 cat 2014-03-04--2014-03-06-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 3883.26*X[0] + 156.74*X[1] + 0.00756*RND() cat 2014-03-04--2014-03-11-slumber-trend-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -terms 2 3772.33*X[0] + 268.94*X[1] + 9.55*RND() cat 2014-03-04--2014-03-08-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 cat 2014-03-09--2014-03-13-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 cat 2014-02-10--2014-02-19-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 cat 2014-02-10--2014-02-21-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 cat 2014-03-16--2014-03-18-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 # Evaluating these trends for plotting: compute_exp_trend.gawk -v DB=6 -v D0=6 -v D1=9 -v H0=8 -v H1=120 -v P0=4375.79 -v P1=404.03 -v Q=0.66 -v R=1.00 compute_exp_trend.gawk -v DB=10 -v D0=10 -v D1=19 -v H0=488 -v H1=120 -v P0=3900.69 -v P1=200.33 -v Q=0.66 -v R=1.00 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=25 -v H0=2048 -v H1=120 -v P0=3832.67 -v P1=-263.0 -v R=1.00 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=25 -v H0=2048 -v H1=120 -v P0=3832.67 -v P1=-263.0 -v R=6.12 compute_lin_trend.gawk -v DB=27 -v D0=26 -v D1=30 -v H0=2528 -v H1=120 -v P0=3521.20 -v P1=-30.30 -v R=1.00 compute_lin_trend.gawk -v DB=27 -v D0=26 -v D1=30 -v H0=2528 -v H1=120 -v P0=3521.20 -v P1=-30.30 -v R=6.12 compute_lin_trend.gawk -v DB=32 -v D0=32 -v D1=34 -v H0=3128 -v H1=120 -v P0=4040.00 -v P1=-84.00 -v R=1.00 compute_lin_trend.gawk -v DB=32 -v D0=32 -v D1=34 -v H0=3128 -v H1=120 -v P0=4040.00 -v P1=-84.00 -v R=6.12 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=9 -v H0=3488 -v H1=120 -v P0=3802.00 -v P1=-134.00 -v R=1.00 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=9 -v H0=3488 -v H1=120 -v P0=3802.00 -v P1=-134.00 -v R=6.12 compute_lin_trend.gawk -v DB=4 -v D0=4 -v D1=7 -v H0=3128 -v H1=120 -v P0=4056.20 -v P1=-91.97 -v R=1.00 compute_lin_trend.gawk -v DB=4 -v D0=4 -v D1=7 -v H0=3128 -v H1=120 -v P0=4056.20 -v P1=-91.97 -v R=6.12 # Note that the R-factor appears to have changed around Mar/03: compute_exp_trend.gawk -v DB=4 -v D0=4 -v D1=6 -v H0=3128 -v H1=120 -v P0=3883.26 -v P1=156.74 -v Q=0.464 -v R=1.00 compute_exp_trend.gawk -v DB=4 -v D0=4 -v D1=6 -v H0=3128 -v H1=120 -v P0=3883.26 -v P1=156.74 -v Q=0.464 -v R=6.00 compute_lin_trend.gawk -v DB=8 -v D0=8 -v D1=11 -v H0=3608 -v H1=120 -v P0=3668.00 -v P1=135.00 -v R=1.00 compute_lin_trend.gawk -v DB=8 -v D0=8 -v D1=11 -v H0=3608 -v H1=120 -v P0=3668.00 -v P1=135.00 -v R=6.00 compute_lin_trend.gawk -v DB=4 -v D0=4 -v D1=11 -v H0=3128 -v H1=120 -v P0=4022.56 -v P1=-60.73 -v R=1.00 compute_lin_trend.gawk -v DB=4 -v D0=4 -v D1=11 -v H0=3128 -v H1=120 -v P0=4022.56 -v P1=-60.73 -v R=6.00 compute_exp_trend.gawk -v DB=4 -v D0=4 -v D1=11 -v H0=3128 -v H1=120 -v P0=3772.33 -v P1=268.94 -v Q=0.700 -v R=1.00 compute_exp_trend.gawk -v DB=4 -v D0=4 -v D1=10 -v H0=3128 -v H1=120 -v P0=3772.33 -v P1=268.94 -v Q=0.700 -v R=6.00 compute_exp_trend.gawk -v DB=4 -v D0=11 -v D1=11 -v H0=3128 -v H1=120 -v P0=3772.33 -v P1=268.94 -v Q=0.700 -v R=6.12 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=18 -v H0=1795 -v H1=24 -v P0=3842.00 -v P1=-84.00 -v R=1.000 compute_exp_trend.gawk -v DB=4 -v D0=4 -v D1=08 -v H0=1507 -v H1=24 -v P0=4143.37 -v P1=-117.14 -v Q=1.420 -v R=1.00 compute_exp_trend.gawk -v DB=9 -v D0=9 -v D1=13 -v H0=1627 -v H1=24 -v P0=3781.88 -v P1=8.71 -v Q=2.000 -v R=1.00 compute_exp_trend.gawk -v DB=10 -v D0=10 -v D1=21 -v H0=979 -v H1=24 -v P0=4106.16 -v P1=-46.12 -v Q=1.252 -v R=1.00 compute_exp_trend.gawk -v DB=10 -v D0=10 -v D1=21 -v H0=979 -v H1=24 -v P0=4098.49 -v P1=-40.17 -v Q=1.270 -v R=1.00 compute_exp_trend.gawk -v DB=10 -v D0=10 -v D1=21 -v H0=979 -v H1=24 -v P0=4113.04 -v P1=-41.22 -v Q=1.290 -v R=1.00 compute_exp_trend.gawk -v DB=16 -v D0=16 -v D1=20 -v H0=1795 -v H1=24 -v P0=3681.68 -v P1=160.32 -v Q=0.476 -v R=1.00 cat 2014-03-16--2014-03-19-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=16 -v D0=16 -v D1=20 -v H0=1795 -v H1=24 -v P0=3722.25 -v P1=112.56 -v Q=0.400 -v R=1.00 cat 2014-03-16--2014-03-20-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=21 -v H0=1795 -v H1=24 -v P0=3818.88 -v P1=-37.70 -v R=1.000 cat 2014-03-16--2014-03-18-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=18 -v H0=1795 -v H1=24 -v P0=3832.77 -v P1=-63.58 -v R=1.000 cat 2014-03-19--2014-03-21-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=22 -v H0=1867 -v H1=24 -v P0=3745.85 -v P1=-99.49 -v R=1.000 cat 2014-03-19--2014-03-22-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=19 -v D0=19 -v D1=24 -v H0=1867 -v H1=24 -v P0=2685.90 -v P1=1061.64 -v Q=0.901 -v R=1.00 cat 2014-03-19--2014-03-23-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=19 -v D0=19 -v D1=24 -v H0=1867 -v H1=24 -v P0=2818.32 -v P1=915.68 -v Q=0.901 -v R=1.00 cat 2014-03-23--2014-03-24-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=25 -v H0=1963 -v H1=24 -v P0=3469.00 -v P1=28.00 -v R=1.00 cat 2014-03-23--2014-03-25-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=26 -v H0=1963 -v H1=24 -v P0=3468.97 -v P1=42.42 -v R=1.00 cat 2014-03-23--2014-03-26-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=27 -v H0=1963 -v H1=24 -v P0=3468.99 -v P1=39.69 -v R=1.00 compute_lin_trend.gawk -v DB=23 -v D0=23 -v D1=26 -v H0=1963 -v H1=24 -v P0=3468.99 -v P1=39.69 -v R=1.00 cat 2014-03-27--2014-03-28-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=27 -v D0=27 -v D1=29 -v H0=2059 -v H1=24 -v P0=3126.00 -v P1=-134.00 -v R=1.00 cat 2014-03-27--2014-03-29-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=27 -v D0=27 -v D1=30 -v H0=2059 -v H1=24 -v P0=2987.36 -v P1=136.38 -v Q=0.100 -v R=1.00 cat 2014-03-31--2014-04-01-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=31 -v D0=31 -v D1=33 -v H0=2155 -v H1=24 -v P0=2759 -v P1=102 -v R=1.00 compute_lin_trend.gawk -v DB=31 -v D0=31 -v D1=32 -v H0=2155 -v H1=24 -v P0=2759 -v P1=102 -v R=1.00 cat 2014-04-03--2014-04-04-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=3 -v D0=3 -v D1=5 -v H0=2227 -v H1=24 -v P0=2670 -v P1=63 -v R=1.00 cat 2014-04-03--2014-04-05-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=3 -v D0=3 -v D1=6 -v H0=2227 -v H1=24 -v P0=2667.94 -v P1=68.82 -v R=1.00 cat 2014-04-03--2014-04-06-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=3 -v D0=3 -v D1=7 -v H0=2227 -v H1=24 -v P0=2670.77 -v P1=64.48 -v R=1.00 compute_lin_trend.gawk -v DB=3 -v D0=3 -v D1=6 -v H0=2227 -v H1=24 -v P0=2670.77 -v P1=64.48 -v R=1.00 cat 2014-04-07--2014-04-08-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=9 -v H0=2323 -v H1=24 -v P0=2782.00 -v P1=13.00 -v R=1.00 cat 2014-04-07--2014-04-09-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=10 -v H0=2323 -v H1=24 -v P0=2791.80 -v P1=-24.92 -v R=1.00 cat 2014-04-07--2014-04-11-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=12 -v H0=2323 -v H1=24 -v P0=2798.22 -v P1=-32.75 -v R=1.00 cat 2014-04-07--2014-04-12-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=13 -v H0=2323 -v H1=24 -v P0=2796.66 -v P1=-31.24 -v R=1.00 cat 2014-04-07--2014-04-13-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=13 -v H0=2323 -v H1=24 -v P0=2797.46 -v P1=-31.81 -v R=1.00 compute_lin_trend.gawk -v DB=14 -v D0=14 -v D1=15 -v H0=2491 -v H1=24 -v P0=2919 -v P1=0.00 -v R=1.00 cat 2014-04-14--2014-04-15-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=14 -v D0=14 -v D1=16 -v H0=2491 -v H1=24 -v P0=2919.00 -v P1=213.00 -v R=1.00 cat 2014-04-14--2014-04-16-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=14 -v D0=14 -v D1=17 -v H0=2491 -v H1=24 -v P0=3202.56 -v P1=-283.56 -v Q=0.24883 -v R=1.00 cat 2014-04-16--2014-04-17-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=18 -v H0=2539 -v H1=24 -v P0=3185.00 -v P1=-92.00 -v R=1.00 cat 2014-04-16--2014-04-18-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=19 -v H0=2539 -v H1=24 -v P0=3187.6 -v P1=-100 -v R=1.00 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=20 -v H0=2539 -v H1=24 -v P0=3187.6 -v P1=-100 -v R=1.00 compute_lin_trend.gawk -v DB=16 -v D0=16 -v D1=18 -v H0=2539 -v H1=24 -v P0=3187.6 -v P1=-100 -v R=1.00 cat 2014-04-19--2014-04-20-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=21 -v H0=2611 -v H1=24 -v P0=3153 -v P1=-28 -v R=1.00 cat 2014-04-19--2014-04-21-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=22 -v H0=2611 -v H1=24 -v P0=3144.19 -v P1=-17.62 -v R=1.00 cat 2014-04-19--2014-04-22-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=23 -v H0=2611 -v H1=24 -v P0=3128.64 -v P1=-4.27 -v R=1.00 cat 2014-04-19--2014-04-23-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=24 -v H0=2611 -v H1=24 -v P0=3151.11 -v P1=-18.42 -v R=1.00 cat 2014-04-19--2014-04-24-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=19 -v D0=19 -v D1=25 -v H0=2611 -v H1=24 -v P0=3138.67 -v P1=-12.01 -v R=1.00 cat 2014-04-25--2014-04-26-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=25 -v D0=25 -v D1=27 -v H0=2755 -v H1=24 -v P0=2814 -v P1=31 -v R=1.00 cat 2014-04-25--2014-04-28-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=25 -v D0=25 -v D1=29 -v H0=2755 -v H1=24 -v P0=+2836.60 -v P1=-38.22 -v R=1.00 cat 2014-04-25--2014-04-29-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=25 -v D0=25 -v D1=30 -v H0=2755 -v H1=24 -v P0=+2813.92 -v P1=-18.83 -v R=1.00 cat 2014-04-28--2014-04-30-slumber-trend-wt-exp.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_exp_trend.gawk -v DB=28 -v D0=28 -v D1=31 -v H0=2827 -v H1=24 -v P0=2820.80 -v P1=-105.80 -v Q=0.56522 -v R=1.00 fit_shifted_exponential.gawk -v Qmin=0.7000 -v Qmax=0.8000 -v Qstep=0.0010 2014-04-28--2014-05-01-slumber-trend-wt-exp.txt compute_exp_trend.gawk -v DB=28 -v D0=28 -v D1=32 -v H0=2827 -v H1=24 -v P0=2913.63 -v P1=-197.68 -v Q=0.7890 -v R=1.00 cat 2014-05-02--2014-05-03-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=2 -v D0=2 -v D1=3.75 -v H0=2923 -v H1=24 -v P0=+2744.00 -v P1=-72.00 -v R=1.00 cat 2014-05-02--2014-05-04-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=2 -v D0=2 -v D1=4.75 -v H0=2923 -v H1=24 -v P0=+2743.73 -v P1=-22.49 -v R=1.00 cat 2014-05-02--2014-05-05-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=2 -v D0=2 -v D1=5.75 -v H0=2923 -v H1=24 -v P0=+2746.70 -v P1=-27.96 -v R=1.00 cat 2014-05-06--2014-05-07-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=6 -v D0=6 -v D1=7.75 -v H0=3019 -v H1=24 -v P0=+2672.00 -v P1=+83.00 -v R=1.00 cat 2014-05-07--2014-05-08-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=8.75 -v H0=3043 -v H1=24 -v P0=+2755.00 -v P1=-12.00 -v R=1.00 cat 2014-05-07--2014-05-09-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=7 -v D0=7 -v D1=9.75 -v H0=3043 -v H1=24 -v P0=+2752.99 -v P1=-6.05 -v R=1.00 cat 2014-05-08--2014-05-10-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=8 -v D0=8 -v D1=10.75 -v H0=3067 -v H1=24 -v P0=+2743.57 -v P1=+26.48 -v R=1.00 cat 2014-05-06--2014-05-10-slumber-trend-wt-lin.txt | egrep -e '^ *[-+.0-9]' | linear_fit -weighted 1 -terms 2 compute_lin_trend.gawk -v DB=6 -v D0=6 -v D1=10 -v H0=3019 -v H1=24 -v P0=+2692.89 -v P1=+27.38 -v R=1.00