Skip to ContentSkip to Navigation
Maatschappij/bedrijvenCentrum voor Informatie TechnologieResearch and Innovation SupportVirtual Reality en Visualisatie

Data approximation

								


      program data_approximation

      dimension x(45),y(45),xk(4)
      data y /1187.,1452.,1325.,1154.,1041.,1261.,1316.,1260.,1296.,
     +  1138., 1002.,1033.,877.,804.,729.,622.,596.,522.,473.,411.,
     +  411.,446.,608.,760.,735.,715.,747.,823.,912.,981.,
     +  1019.,1128.,
     +  1210., 1308., 1407., 1464., 1586., 1830., 2165., 2389.,
     +  2672., 4533., 3736., 4088., 4401. /

c This program demonstrates data approximation upon data
c of the use of Frisian stallions in 1952 - 1982, taken from
c "Het Friese hengstenboek" (E. Dijkstra, Kollum).
c remaining data from Auke Meetsma ...

c The graph shows the decline of the Frisian working-horse
c and the resurrection as a coach-horse.

      call FRAME_STYLE ('CBS')
      call SCALE_DIMENSIONS(0.8)
      call ps_define_font('A','Helvetica')
      call TICK_DISTANCES (1.5, 1.1)
      call SCALE_ANNOTATIONS (1.5)
      call FORMAT_X_AXISNUMBERS (0,0)
      call FORMAT_Y_AXISNUMBERS (0,0)

      call FRAME(13.5, 1950., 1995., 9.9, 0., 4500.,
     +'Year', ' ', 'Nr. of mountings of Frisian stallions')

c generate x-coordinates:
      np=45
      do 10 i=1,np
10    x(i)=1950+i

      call ps_graph_attributes(0.05, 0)
      call MARKERS (' ', np, x, y, 17)
      call LOCAL_PARABOLA_AP ('local parabola fiting', np, x, y, 1)

c cubic spline smoothing with nk knots in xk
        xk(1)=1958
        xk(2)=1965
        xk(3)=1972
        xk(4)=1990
        call line_style_nr(1)
        call SPLINE_VAR_KNOTS_AP('spline with variable knots ',
     +   np, x, y, 4, xk)

c internal KOMPLOT call:
c     call KOMPLOT(40, 'da.ps')
c     call system('xv da.ps')
      end

							
Last modified:02 October 2015 10.22 p.m.