Previous: fitds Up: ../plot79_f.html Next: fitin


FITDSM

       SUBROUTINE  FITDSM (H, N, TNODE, G, WGS, RHO, GSMO, B, C, D)
 C$    (ALG547 - Discrete Smoothing Cubic Spline)
 C$    This subroutine computes the discrete natural cubic  spline
 C$    defined on the  interval (TNODE(1),TNODE(N)) which  smooths
 C$    through the data (TNODE(I),G(I)),I=1,2,...,N.  N must be  2
 C$    or  greater.   The   nodes  must   satisfy  TNODE(I)   .LT.
 C$    TNODE(I+1).  The  solution  S(T)  for  T  in  the  interval
 C$    (TNODE(I),TNODE(I+1)) is given by
 C$
 C$    S(T)=GSMO(I)+B(I)*(T-TNODE(I))+
 C$            C(I)*(T-TNODE(I))**2+D(I)*(T-TNODE(I))**3
 C$
 C$
 C$    Input parameters (none of the input parameters are  changed
 C$    by this subroutine)
 C$
 C$    H.........the step size used for the discrete cubic spline
 C$    N.........number of nodes (TNODE) and data values (G)
 C$    TNODE(*)..REAL array containing the nodes (TNODE(I) .LT.
 C$              TNODE(I+1)).
 C$    G(*)......REAL array containing the data values.
 C$    WGS(*)....REAL array containing the weights WGS(I)
 C$              corresponding to the data (TNODE(I),G(I)).
 C$    RHO.......simple  REAL  variable  containing  the  positive
 C$              parameter for varying the smoothness of the  fit.
 C$              If RHO is small smoothness is emphasized.  If RHO
 C$              is large data fitting is emphasized.
 C$
 C$    Output parameters
 C$
 C$    GSMO(*)...REAL array containing the smoothed values of
 C$              the data G(I),I=1,2,....,N.
 C$    B(*)......REAL array containing the coefficients B(I) for
 C$              the terms (T-TNODE(I)).
 C$    C(*)......REAL array containing the coefficients C(I) for
 C$              the terms (T-TNODE(I))**2.
 C$    D(*)......REAL array containing the coefficients D(I) for
 C$              the terms (T-TNODE(I))**3.
 C$
 C$    This routine has been developed and described by
 C$
 C$    Charles S.  Duris,  "Discrete Interpolation  and  Smoothing
 C$    Spline Functions", SIAM J. Numer. Anal. 14, 686-698 (1977).
 C$
 C$    Charles S.  Duris, "Algorithm  547 -  FORTRAN Routines  for
 C$    Discrete   Cubic   Spline   Interpolation   And   Smoothing
 C$    (E1),(E3)", ACM  Trans. Math.  Software  6, No.  1,  92-103
 C$    (March 1980).
 C$
 C$    (03-APR-82)