set title 'Sterbetafel_Deutschland_2014_2016.csv' # Berechne Weibull-Funktion von AG 0..2 von # Sterbetafel_Deutschland_2014_2016.csv # Berechne Funktionswerte bei 0.5, 1.5, 2.5 für die Halbjahresverschiebung # für SIKURS Sterberate set tics out #set fit logfile 'fit.log' #set print 'wib.txt' w(x) = X-exp(-(((x-t)/(T-t))**b)); X = 1 T = -10 b = 4 t = 4 set term wxt 1 noenhanced size 800,600 font 'Arial,10' title 'Plot 1' background rgb '#ffffff' set xrange[0:3] set yrange[*:*] $DATA << EOT 0 0.00354659 1 0.0002724 2 0.00015597 3 0.00012875 EOT w0 = 0.00354659 w1 = 0.0002724 w2 = 0.00015597 w3 = 0.00012875 fit w(x) $DATA using 1:2 via X, T, b, t do for [x=0:1] { print x+0.5, w(x+0.5) } q_0 = (w(0)-w(0.5))/(w(0)-w(1)) q_1 = (w(1)-w(1.5))/(w(1)-w2) q_2 = 0.5 s_0 = w(0)*q_0 s_1 = w(0)*(1-q_0)+w(1)*q_1 s_2 = w(1)*(1-q_1)+w2*q_2 print "q" print 0, q_0 print 1, q_1 print 'strb' print 0, s_0 print 1, s_1 print 2, s_2 set arrow from 0,s_0 to 1,s_0 nohead lt 3 set arrow from 1,s_0 to 1,s_1 nohead lt 3 set arrow from 1,s_1 to 2,s_1 nohead lt 3 set arrow from 2,s_1 to 2,s_2 nohead lt 3 set arrow from 2,s_2 to 3,s_2 nohead lt 3 # aktuelle hst Formel s_0 = w0/2 s_1 = (w0+w1)/2 s_2 = (w1+w2)/2 set arrow from 0,s_0 to 1,s_0 nohead lt 0 set arrow from 1,s_0 to 1,s_1 nohead lt 0 set arrow from 1,s_1 to 2,s_1 nohead lt 0 set arrow from 2,s_1 to 2,s_2 nohead lt 0 set arrow from 2,s_2 to 3,s_2 nohead lt 0 plot w(x) title sprintf('weibull(%g,%g,%g,%g)', X, T, b, t)\ , $DATA with points pause mouse close