1CURVS1(3NCARG)                   NCAR GRAPHICS                  CURVS1(3NCARG)
2
3
4

NAME

6       CURVS1 - calculate values for a smoothing spline for data in the plane.
7

SYNOPSIS

9       CALL CURVS1 (N,X,Y,D,ISW,S,EPS,PARAM,XS,YS,XSP,YSP,
10                    SIGMA,TEMP,IERR)
11
12       This  subroutine  calculates  certain values that are used by CURVS2 in
13       order to  compute  an  interpolatory  smoothing  spline  under  tension
14       through  a sequence of data values in the plane.  In general this curve
15       will not pass through the original data points.  The actual computation
16       of the interpolated values must be done using CURVS2.
17
18       Three  parameters are used to control the degree of smoothness -- D, S,
19       and EPS.
20
21       The parameter D is a value indicating the degree of confidence  in  the
22       accuracy  of the input function values -- it should be an approximation
23       of the standard deviation of error. Effectively the value of D controls
24       how  close  the  smoothed curve comes to the input data points. If D is
25       small then the interpolated curve will pass close to  the  input  data.
26       The larger the value of D, the more freedom the smooth curve has in how
27       close it comes to the input data values.
28
29       S is a more subtle global smoothing parameter. S must be  non-negative.
30       For  small values of S, the interpolated curve approximates the tension
31       spline and for larger values of S, the curve is smoother. A  reasonable
32       value for S is REAL(N).
33
34       EPS  controls  the  precision  to  which  S is interpreted; EPS must be
35       between  0.  and  1.  inclusive.  A  reasonable  value   for   EPS   is
36       SQRT(2./REAL(N)).
37

DESCRIPTION

39       N           (integer, input) The number of input data values. (N > 1)
40
41       X           (integer,  input) An array containing the X-coordinates for
42                   the input data.  These need not be increasing.
43
44       Y           (integer, input) An array containing the Y-coordinates  for
45                   the input data.
46
47       D           (integer,  input)  A  user-specified  value  containing the
48                   observed weights. D may be either an  array  or  a  scalar,
49                   depending on the value of ISW (as described below).
50
51       ISW         (integer,  input) A switch for interpreting the value of D.
52                   If ISW=0, then D is an array of length  N  (D  contains  an
53                   individual  error  estimate  for each input data value); if
54                   ISW=1, then D is a scalar that serves as an error  estimate
55                   for every single data item.
56
57       S           (integer,  input)  Contains the value for smoothing. S must
58                   be non-negative.  Larger values for S yield greater smooth‐
59                   ing. A reasonable value is REAL(N).
60
61       EPS         (integer,  input)  Contains a tolerance value for the rela‐
62                   tive precision to which S should be interpreted.  EPS  must
63                   be  between  0.  and  1.  inclusive.  A reasonable value is
64                   SQRT(2./REAL(N)).
65
66       PARAM       (integer, output) PARAM(I) is the arc length of  the  curve
67                   up  through  point  (X(I),Y(I)),  divided  by the total arc
68                   length.
69
70       XS          (integer, output) An  array  of  length  N.   Contains  the
71                   smoothed values.
72
73       XSP         (integer,  output)  An  array of length N.  Contains second
74                   derivative information for the X-coordinate values.
75
76       YS          (integer, output) An  array  of  length  N.   Contains  the
77                   smoothed values.
78
79       YSP         (integer,  output)  An  array of length N.  Contains second
80                   derivative information for the X-coordinate values.
81
82       SIGMA       (integer, input) Tension factor. Values near zero result in
83                   a  cubic  spline; large values (e.g. 50) result in nearly a
84                   polygonal line. A typical value is 1.
85
86       TEMP        (integer, input) Scratch space of length at least 19*N.
87
88       IER         (integer, output) An error return value. If IER is returned
89                   as 0, then no errors were detected.
90
91                   = 1 if N is less than 2.
92                   = 2 if S is negative.
93                   = 3 if EPS is negative or greater than 1.
94                   = 5 if D is negative.
95

ACCESS

97       To use CURVS1, load the NCAR Graphics library ngmath.
98

SEE ALSO

100       curvs2, fitgrid_params.
101
102       Complete documentation for Fitgrid is available at URL
103       http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html
104
106       Copyright (C) 2000
107       University Corporation for Atmospheric Research
108
109       The use of this Software is governed by a License Agreement.
110
111
112
113UNIX                              August 2002                   CURVS1(3NCARG)
Impressum