# Last edited on 2015-04-17 23:21:25 by stolfilocal FITTING A POLYNOMIAL TO THE REF PRICE Obtaining the ref price file: dtini="2010-07-17" dtfin="2019-12-29" fname="${dtini}--${dtfin}-PREF-USD-01d.txt" cp ../00-DATA/series/fix/${fname} ./ ln -s ${fname} price-01d.txt Preparing a file with date and price, padded with two years of zeros: cat price-01d.txt \ | create_data_file.gawk \ -v dtfin="${dtfin}" \ > data.txt Computing a first-degree fit on data up to late 2013: compute_and_plot_deg1_rise_fit.sh 2010-07-12 2022-01-05 0.04 60000000000.00 Fit a quadratic to the full data: compute_and_plot_deg2_full_fit.sh 2010-07-12 2022-01-05 0.04 24000.00 >> JUNK >> PREDICTING GAINS # Someone posted the % gains in USD/BTC from April to April. # Fitting a quadratic: prefix="2014-04-24-april" pricesfile="${prefix}-prices.txt" gainsfile="${prefix}-gains.txt" compute_april_gains_file.sh ${prefix} cat ${gainsfile} | linear_fit -weighted 0 -terms 3 plot_april_gains.sh ${prefix} # Someone posted prices november-to-november: # https://bitcointalk.org/index.php?topic=178336.msg9443938#msg9443938 # Fitting a parabola: prefix="2014-11-05-nov" pricesfile="${prefix}-prices-0.txt" cat ${pricesfile} | linear_fit -weighted 0 -terms 3 plot_nov_prices.sh ${prefix} 0 10 308 -74 logpricesfile="${prefix}-prices-1.txt" cat ${pricesfile} | gawk '/^20/{ printf "%9.4f %10.6f %d %d %d\n", $1, log($2)/log(10), $3, $4, $5; }' > ${logpricesfile} cat ${logpricesfile} | linear_fit -weighted 0 -terms 3 plot_nov_prices.sh ${prefix} 1 1.000000 2.015523 -0.628133