~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/interpolation/help/en_US/lsq_splin.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="lsq_splin" xml:lang="en">
3
 
  <refnamediv>
4
 
    <refname>lsq_splin</refname>
5
 
    <refpurpose>weighted least squares cubic spline fitting</refpurpose>
6
 
  </refnamediv>
7
 
  <refsynopsisdiv>
8
 
    <title>Calling Sequence</title>
9
 
    <synopsis>[y, d] = lsq_splin(xd, yd [, wd], x)</synopsis>
10
 
  </refsynopsisdiv>
11
 
  <refsection>
12
 
    <title>Arguments</title>
13
 
    <variablelist>
14
 
      <varlistentry>
15
 
        <term>xd, yd</term>
16
 
        <listitem>
17
 
          <para>vectors of the same size, data to be fitted by a cubic
18
 
            spline
19
 
          </para>
20
 
        </listitem>
21
 
      </varlistentry>
22
 
      <varlistentry>
23
 
        <term>wd</term>
24
 
        <listitem>
25
 
          <para>
26
 
            (optional) a vector of same format than <literal>xd</literal>
27
 
            and <literal>yd</literal>, weights of the least square fit.
28
 
          </para>
29
 
        </listitem>
30
 
      </varlistentry>
31
 
      <varlistentry>
32
 
        <term>x</term>
33
 
        <listitem>
34
 
          <para>a strictly increasing (row or column) vector, breakpoints of
35
 
            the cubic spline
36
 
          </para>
37
 
        </listitem>
38
 
      </varlistentry>
39
 
      <varlistentry>
40
 
        <term>y, d</term>
41
 
        <listitem>
42
 
          <para>
43
 
            vectors of same format than <literal>x</literal>, the triplet
44
 
            (x,y,d) defines the approximated cubic spline.
45
 
          </para>
46
 
        </listitem>
47
 
      </varlistentry>
48
 
    </variablelist>
49
 
  </refsection>
50
 
  <refsection>
51
 
    <title>Description</title>
52
 
    <para>This function computes an approximated cubic spline
53
 
      <emphasis>s</emphasis> for the data <literal>xd, yd, wd</literal> (in the
54
 
      following <emphasis>m</emphasis> is supposed to be the length of these
55
 
      vectors) and from a choice of the spline breakpoints <literal>x</literal>
56
 
      (for instance if you want n breakpoints uniformly chosen you may use
57
 
      <literal>x=linspace(min(xd),max(xd),n))</literal>). If
58
 
      <emphasis>S</emphasis> is the space of all cubic splines functions with
59
 
      breakpoints <emphasis>x1 &lt; x2 &lt; ... &lt; xn</emphasis> then the
60
 
      resulting spline <emphasis>s</emphasis> is such that:
61
 
    </para>
62
 
    <informalequation>
63
 
      <mediaobject>
64
 
        <imageobject>
65
 
          <imagedata align="center" fileref="../mml/lsq_splin_equation1.mml"/>
66
 
        </imageobject>
67
 
      </mediaobject>
68
 
    </informalequation>
69
 
    <para>
70
 
      for all <emphasis>fin S</emphasis>, i.e. realizes the minimum of
71
 
      the sum of the squared errors over all functions of
72
 
      <emphasis>S</emphasis>.
73
 
    </para>
74
 
    <para>
75
 
      The spline <emphasis>s</emphasis> is completely defined by the
76
 
      triplet <literal>(x,y,d)</literal> (<literal>y</literal> and
77
 
      <literal>d</literal> are the vectors of the spline ordinates and first
78
 
      derivatives at the xi 's : <emphasis>yi=s(xi)</emphasis> and
79
 
      <emphasis>di=s'(xi)</emphasis>) and its evaluation at some points must be
80
 
      done by the <link linkend="interp">interp</link> function.
81
 
    </para>
82
 
  </refsection>
83
 
  <refsection>
84
 
    <title>Remarks</title>
85
 
    <para>
86
 
      When <literal>wd</literal> is not given, all the points have the
87
 
      same weight 1.
88
 
    </para>
89
 
    <para>
90
 
      A point <emphasis>(xd(k),yd(k))</emphasis> is considered in the fit
91
 
      if <emphasis>xd(k) in [x1,xn] and wd(k) &gt; 0</emphasis>. In particular
92
 
      you can put a null (or even negative) weight to all data points you want
93
 
      to ignore in the fitting. When the total number of points taken into
94
 
      account in the fit procedure is (strictly) less than 4 an error is
95
 
      issued.
96
 
    </para>
97
 
    <para>
98
 
      The vector <literal>xd</literal> do not need to be in increasing
99
 
      order.
100
 
    </para>
101
 
    <para>Depending on the number and on the positions of the
102
 
      <emphasis>xd(k)</emphasis> 's and on the choice of the
103
 
      <emphasis>x(i)</emphasis> 's there may be several solutions but only one
104
 
      is selected. When this occurs a warning message is displayed in the Scilab
105
 
      command window. This function is intended to be used when
106
 
      <emphasis>m</emphasis> is much larger than <emphasis>n</emphasis> and in
107
 
      this case no such problem may occurred.
108
 
    </para>
109
 
  </refsection>
110
 
  <refsection>
111
 
    <title>Examples</title>
112
 
    <programlisting role="example"><![CDATA[ 
 
3
    <refnamediv>
 
4
        <refname>lsq_splin</refname>
 
5
        <refpurpose>weighted least squares cubic spline fitting</refpurpose>
 
6
    </refnamediv>
 
7
    <refsynopsisdiv>
 
8
        <title>Calling Sequence</title>
 
9
        <synopsis>[y, d] = lsq_splin(xd, yd [, wd], x)</synopsis>
 
10
    </refsynopsisdiv>
 
11
    <refsection>
 
12
        <title>Arguments</title>
 
13
        <variablelist>
 
14
            <varlistentry>
 
15
                <term>xd, yd</term>
 
16
                <listitem>
 
17
                    <para>vectors of the same size, data to be fitted by a cubic
 
18
                        spline
 
19
                    </para>
 
20
                </listitem>
 
21
            </varlistentry>
 
22
            <varlistentry>
 
23
                <term>wd</term>
 
24
                <listitem>
 
25
                    <para>
 
26
                        (optional) a vector of same format than <literal>xd</literal>
 
27
                        and <literal>yd</literal>, weights of the least square fit.
 
28
                    </para>
 
29
                </listitem>
 
30
            </varlistentry>
 
31
            <varlistentry>
 
32
                <term>x</term>
 
33
                <listitem>
 
34
                    <para>a strictly increasing (row or column) vector, breakpoints of
 
35
                        the cubic spline
 
36
                    </para>
 
37
                </listitem>
 
38
            </varlistentry>
 
39
            <varlistentry>
 
40
                <term>y, d</term>
 
41
                <listitem>
 
42
                    <para>
 
43
                        vectors of same format than <literal>x</literal>, the triplet
 
44
                        (x,y,d) defines the approximated cubic spline.
 
45
                    </para>
 
46
                </listitem>
 
47
            </varlistentry>
 
48
        </variablelist>
 
49
    </refsection>
 
50
    <refsection>
 
51
        <title>Description</title>
 
52
        <para>This function computes an approximated cubic spline
 
53
            <emphasis>s</emphasis> for the data <literal>xd, yd, wd</literal> (in the
 
54
            following <emphasis>m</emphasis> is supposed to be the length of these
 
55
            vectors) and from a choice of the spline breakpoints <literal>x</literal>
 
56
            (for instance if you want n breakpoints uniformly chosen you may use
 
57
            <literal>x=linspace(min(xd),max(xd),n))</literal>). If
 
58
            <emphasis>S</emphasis> is the space of all cubic splines functions with
 
59
            breakpoints <emphasis>x1 &lt; x2 &lt; ... &lt; xn</emphasis> then the
 
60
            resulting spline <emphasis>s</emphasis> is such that:
 
61
        </para>
 
62
        <informalequation>
 
63
            <mediaobject>
 
64
                <imageobject>
 
65
                    <imagedata align="center" fileref="../mml/lsq_splin_equation1.mml"/>
 
66
                </imageobject>
 
67
            </mediaobject>
 
68
        </informalequation>
 
69
        <para>
 
70
            for all <emphasis>fin S</emphasis>, i.e. realizes the minimum of
 
71
            the sum of the squared errors over all functions of
 
72
            <emphasis>S</emphasis>.
 
73
        </para>
 
74
        <para>
 
75
            The spline <emphasis>s</emphasis> is completely defined by the
 
76
            triplet <literal>(x,y,d)</literal> (<literal>y</literal> and
 
77
            <literal>d</literal> are the vectors of the spline ordinates and first
 
78
            derivatives at the xi 's : <emphasis>yi=s(xi)</emphasis> and
 
79
            <emphasis>di=s'(xi)</emphasis>) and its evaluation at some points must be
 
80
            done by the <link linkend="interp">interp</link> function.
 
81
        </para>
 
82
    </refsection>
 
83
    <refsection>
 
84
        <title>Remarks</title>
 
85
        <para>
 
86
            When <literal>wd</literal> is not given, all the points have the
 
87
            same weight 1.
 
88
        </para>
 
89
        <para>
 
90
            A point <emphasis>(xd(k),yd(k))</emphasis> is considered in the fit
 
91
            if <emphasis>xd(k) in [x1,xn] and wd(k) &gt; 0</emphasis>. In particular
 
92
            you can put a null (or even negative) weight to all data points you want
 
93
            to ignore in the fitting. When the total number of points taken into
 
94
            account in the fit procedure is (strictly) less than 4 an error is
 
95
            issued.
 
96
        </para>
 
97
        <para>
 
98
            The vector <literal>xd</literal> do not need to be in increasing
 
99
            order.
 
100
        </para>
 
101
        <para>Depending on the number and on the positions of the
 
102
            <emphasis>xd(k)</emphasis> 's and on the choice of the
 
103
            <emphasis>x(i)</emphasis> 's there may be several solutions but only one
 
104
            is selected. When this occurs a warning message is displayed in the Scilab
 
105
            command window. This function is intended to be used when
 
106
            <emphasis>m</emphasis> is much larger than <emphasis>n</emphasis> and in
 
107
            this case no such problem may occurred.
 
108
        </para>
 
109
    </refsection>
 
110
    <refsection>
 
111
        <title>Examples</title>
 
112
        <programlisting role="example"><![CDATA[ 
113
113
// this is an artificial example where the data xd and yd
114
114
// are build from a perturbed sin function
115
115
a = 0; b = 2*%pi;
133
133
xtitle("a least square spline")
134
134
show_window()
135
135
 ]]></programlisting>
136
 
  </refsection>
137
 
  <refsection role="see also">
138
 
    <title>See Also</title>
139
 
    <simplelist type="inline">
140
 
      <member>
141
 
        <link linkend="interp">interp</link>
142
 
      </member>
143
 
      <member>
144
 
        <link linkend="splin">splin</link>
145
 
      </member>
146
 
    </simplelist>
147
 
  </refsection>
 
136
    </refsection>
 
137
    <refsection role="see also">
 
138
        <title>See Also</title>
 
139
        <simplelist type="inline">
 
140
            <member>
 
141
                <link linkend="interp">interp</link>
 
142
            </member>
 
143
            <member>
 
144
                <link linkend="splin">splin</link>
 
145
            </member>
 
146
        </simplelist>
 
147
    </refsection>
148
148
</refentry>