Warning, /graphics/kst-plot/docbook/kst/plugins-chapter.docbook is written in an unsupported language. File is not indexed.

0001 <chapter id="pluginsandfilters">
0002 <title>Plugins, Fits, and Filters</title>
0003 
0004 <sect1>
0005 <title>Using Plugins, Fits, and Filters</title>
0006 <para>
0007 Many of the mathematical data operators in &kst;, including fits and filters, are implemented as plugins.  Plugins are loaded at run time and use a stable API, so it is possible to write your own plugins and include them in your local installation without re-compiling &kst;.  Fits and Filters are simply subsets of the set of plugins, and thus behave identically to generic plugins, with the exception of additional convenience dialog functionality when selected from the plot context menu.  See <link linkend="fits">here</link> for a general description of the creation of fits and filters.
0008 </para>
0009 
0010 <para>
0011   To date, there are more than 25 built-in plugins available in &kst; that perform functions from taking cross correlations of two vectors to producing periodograms of a data set.  The following screenshot shows the settings window for a typical plugin, created by selecting the desired plugin from the <guimenu>Standard Plugin</guimenu>, <guimenu>Fit Plugin</guimenu> or <guimenu>Filter Plugin</guimenu> submenus in the <guimenu>Create</guimenu> toolbar menu.
0012 </para>
0013 
0014 
0015 <screenshot>
0016 <screeninfo>Plugins Window</screeninfo>
0017 <mediaobject>
0018 <imageobject>
0019 <imagedata fileref="Screenshot-kst-plugin.png" format="PNG" />
0020 </imageobject>
0021 <textobject>
0022 <phrase>Plugins Windowpluginswindow</phrase>
0023 </textobject>
0024 </mediaobject>
0025 </screenshot>
0026 
0027 <para>
0028 The following sections describe the purpose, key algorithms or formulas used to perform calculations,
0029 and inputs and outputs for each plugin.  Note that fitting and filtering plugins are included in the following sections.
0030 </para>
0031 
0032 
0033 <!-- Begin the long plugins section.  -->
0034 <sect2 id="plugin-autocorrelation">
0035 <title>Autocorrelation</title>
0036 <para>
0037 The autocorrelation plugin calculates correlation values between a series (vector) and a lagged version
0038 of itself, using lag values from <literal>floor(-(N-1)/2)</literal> to <literal>floor((N-1)/2)</literal>, where <literal>N</literal>
0039 is the number of points in the data set.  The time
0040 vector is not an input as it is assumed that the data is sampled at equal time intervals.  The correlation
0041 value <literal>r</literal> at lag <literal>k</literal> is:
0042 </para>
0043 <para>
0044 <inlinemediaobject>
0045 <imageobject>
0046 <imagedata fileref="Formula-kst-autocorrelation.png" format="PNG" />
0047 </imageobject>
0048 <textobject>
0049 <phrase>Autocorrelation formula</phrase>
0050 </textobject>
0051 </inlinemediaobject>
0052 </para>
0053 
0054 <sect3 id="plugin-autocorrelation-inputs">
0055 <title>Inputs</title>
0056 <variablelist>
0057 
0058 <varlistentry>
0059 <term>X Array (vector)</term>
0060 <listitem>
0061 <para>
0062 The array <literal>x</literal> of values to calculate correlation values for.
0063 </para>
0064 </listitem>
0065 </varlistentry>
0066 
0067 </variablelist>
0068 </sect3>
0069 
0070 <sect3 id="plugin-autocorrelation-outputs">
0071 <title>Outputs</title>
0072 <variablelist>
0073 
0074 <varlistentry>
0075 <term>Step Number (vector)</term>
0076 <listitem>
0077 <para>
0078 The array of step, or lag values.
0079 </para>
0080 </listitem>
0081 </varlistentry>
0082 
0083 <varlistentry>
0084 <term>Correlation Value (vector)</term>
0085 <listitem>
0086 <para>
0087 The array of correlation values calculated using the corresponding step number in the Step Number vector.
0088 </para>
0089 </listitem>
0090 </varlistentry>
0091 
0092 </variablelist>
0093 </sect3>
0094 
0095 </sect2>
0096 
0097 <sect2 id="plugin-bin">
0098 <title>Bin</title>
0099 <para>
0100 The bin plugin bins elements of a single data vector into bins of a specified size.  The value of each bin is the mean
0101 of the elements belonging to the bin. For example, if the bin size is <literal>3</literal>, and the input vector is
0102 <literal>[9,2,7,3,4,74,5,322,444,2,1]</literal>, then the outputted bins would be
0103 <literal>[6,27,257]</literal>.  Note that any elements remaining at the end of the input vector that do not form a complete
0104 bin (in this case, elements <literal>2</literal> and <literal>1</literal>), are simply discarded.
0105 </para>
0106 <sect3 id="plugin-bin-inputs">
0107 <title>Inputs</title>
0108 <variablelist>
0109 
0110 <varlistentry>
0111 <term>Input Vector (vector)</term>
0112 <listitem>
0113 <para>
0114 The vector to bin.
0115 </para>
0116 </listitem>
0117 </varlistentry>
0118 
0119 <varlistentry>
0120 <term>Bin Size (scalar)</term>
0121 <listitem>
0122 <para>
0123 The size to use for each bin.
0124 </para>
0125 </listitem>
0126 </varlistentry>
0127 
0128 </variablelist>
0129 </sect3>
0130 
0131 <sect3 id="plugin-bin-outputs">
0132 <title>Outputs</title>
0133 <variablelist>
0134 
0135 <varlistentry>
0136 <term>Bins (vector)</term>
0137 <listitem>
0138 <para>
0139 The array of means for each bin.
0140 </para>
0141 </listitem>
0142 </varlistentry>
0143 </variablelist>
0144 </sect3>
0145 
0146 </sect2>
0147 
0148 <sect2 id="plugin-butterworth_bandpass">
0149 <title>Butterworth band-pass</title>
0150 <para>
0151 The Butterworth band-pass plugin filters a set of data by calculating
0152 the Fourier transform of the data and recalculating the
0153 the frequency responses using the following formula
0154 </para>
0155 <para>
0156 <inlinemediaobject>
0157 <imageobject>
0158 <imagedata fileref="Formula-kst-bandpass.png" format="PNG" />
0159 </imageobject>
0160 <textobject>
0161 <phrase>Autocorrelation formula</phrase>
0162 </textobject>
0163 </inlinemediaobject>
0164 </para>
0165 <para>
0166 where <literal>f</literal> is the frequency, <literal>f<subscript>c</subscript></literal> is
0167 the low frequency cutoff, <literal>b</literal> is the bandwidth of the band to pass, and
0168 <literal>n</literal> is the order of the Butterworth filter.  The inverse Fourier transform
0169 is then calculated using the new filtered frequency responses.
0170 </para>
0171 
0172 <sect3 id="plugin-butterworth_bandpass-inputs">
0173 <title>Inputs</title>
0174 <variablelist>
0175 
0176 <varlistentry>
0177 <term>X Array (vector)</term>
0178 <listitem>
0179 <para>
0180 The array of values to filter.
0181 </para>
0182 </listitem>
0183 </varlistentry>
0184 
0185 <varlistentry>
0186 <term>Order (scalar)</term>
0187 <listitem>
0188 <para>
0189 The order of the Butterworth filter to use.
0190 </para>
0191 </listitem>
0192 </varlistentry>
0193 
0194 <varlistentry>
0195 <term>Low cutoff frequency (scalar)</term>
0196 <listitem>
0197 <para>
0198 The low cutoff frequency of the Butterworth band pass filter.
0199 </para>
0200 </listitem>
0201 </varlistentry>
0202 
0203 <varlistentry>
0204 <term>Band width (scalar)</term>
0205 <listitem>
0206 <para>
0207 The width of the band to pass.  This should be the difference between the desired high
0208 cutoff frequency and the low cutoff frequency.
0209 </para>
0210 </listitem>
0211 </varlistentry>
0212 
0213 </variablelist>
0214 </sect3>
0215 
0216 <sect3 id="plugin-butterworth_bandpass-outputs">
0217 <title>Outputs</title>
0218 <variablelist>
0219 
0220 <varlistentry>
0221 <term>X Filtered (vector)</term>
0222 <listitem>
0223 <para>
0224 The array of filtered data values.
0225 </para>
0226 </listitem>
0227 </varlistentry>
0228 
0229 </variablelist>
0230 </sect3>
0231 
0232 </sect2>
0233 
0234 <sect2 id="plugin-butterworth_bandstop">
0235 <title>Butterworth band-stop</title>
0236 <para>
0237 The Butterworth band-stop plugin filters a set of data by calculating
0238 the Fourier transform of the data and recalculating the
0239 the frequency responses using the following formula
0240 </para>
0241 <para>
0242 <inlinemediaobject>
0243 <imageobject>
0244 <imagedata fileref="Formula-kst-bandstop.png" format="PNG" />
0245 </imageobject>
0246 <textobject>
0247 <phrase>Autocorrelation formula</phrase>
0248 </textobject>
0249 </inlinemediaobject>
0250 </para>
0251 <para>
0252 where <literal>f</literal> is the frequency, <literal>f<subscript>c</subscript></literal> is
0253 the low frequency cutoff, <literal>b</literal> is the bandwidth of the band to stop, and
0254 <literal>n</literal> is the order of the Butterworth filter.  The inverse Fourier transform
0255 is then calculated using the new filtered frequency responses.
0256 </para>
0257 <sect3 id="plugin-butterworth_bandstop-inputs">
0258 <title>Inputs</title>
0259 <variablelist>
0260 
0261 <varlistentry>
0262 <term>X Array (vector)</term>
0263 <listitem>
0264 <para>
0265 The array of values to filter.
0266 </para>
0267 </listitem>
0268 </varlistentry>
0269 
0270 <varlistentry>
0271 <term>Order (scalar)</term>
0272 <listitem>
0273 <para>
0274 The order of the Butterworth filter to use.
0275 </para>
0276 </listitem>
0277 </varlistentry>
0278 
0279 <varlistentry>
0280 <term>Low cutoff frequency (scalar)</term>
0281 <listitem>
0282 <para>
0283 The low cutoff frequency of the Butterworth band stop filter.
0284 </para>
0285 </listitem>
0286 </varlistentry>
0287 
0288 <varlistentry>
0289 <term>Band width (scalar)</term>
0290 <listitem>
0291 <para>
0292 The width of the band to stop.  This should be the difference between the desired high
0293 cutoff frequency and the low cutoff frequency.
0294 </para>
0295 </listitem>
0296 </varlistentry>
0297 
0298 </variablelist>
0299 </sect3>
0300 
0301 <sect3 id="plugin-butterworth_bandstop-outputs">
0302 <title>Outputs</title>
0303 <variablelist>
0304 
0305 <varlistentry>
0306 <term>X Filtered (vector)</term>
0307 <listitem>
0308 <para>
0309 The array of filtered data values.
0310 </para>
0311 </listitem>
0312 </varlistentry>
0313 
0314 </variablelist>
0315 </sect3>
0316 
0317 </sect2>
0318 
0319 <sect2 id="plugin-butterworth_highpass">
0320 <title>Butterworth high-pass</title>
0321 <para>
0322 The Butterworth high-pass plugin filters a set of data by calculating
0323 the Fourier transform of the data and recalculating the
0324 the frequency responses using the following formula
0325 </para>
0326 <para>
0327 <inlinemediaobject>
0328 <imageobject>
0329 <imagedata fileref="Formula-kst-highpass.png" format="PNG" />
0330 </imageobject>
0331 <textobject>
0332 <phrase>Autocorrelation formula</phrase>
0333 </textobject>
0334 </inlinemediaobject>
0335 </para>
0336 <para>
0337 where <literal>f</literal> is the frequency, <literal>f<subscript>c</subscript></literal> is
0338 the high frequency cutoff, and
0339 <literal>n</literal> is the order of the Butterworth filter.  The inverse Fourier transform
0340 is then calculated using the new filtered frequency responses.
0341 </para>
0342 <sect3 id="plugin-butterworth_highpass-inputs">
0343 <title>Inputs</title>
0344 <variablelist>
0345 
0346 <varlistentry>
0347 <term>X Array (vector)</term>
0348 <listitem>
0349 <para>
0350 The array of values to filter.
0351 </para>
0352 </listitem>
0353 </varlistentry>
0354 
0355 <varlistentry>
0356 <term>Order (scalar)</term>
0357 <listitem>
0358 <para>
0359 The order of the Butterworth filter to use.
0360 </para>
0361 </listitem>
0362 </varlistentry>
0363 
0364 <varlistentry>
0365 <term>Cutoff frequency (scalar)</term>
0366 <listitem>
0367 <para>
0368 The cutoff frequency of the Butterworth high pass filter.
0369 </para>
0370 </listitem>
0371 </varlistentry>
0372 
0373 
0374 </variablelist>
0375 </sect3>
0376 
0377 <sect3 id="plugin-butterworth_highpass-outputs">
0378 <title>Outputs</title>
0379 <variablelist>
0380 
0381 <varlistentry>
0382 <term>X Filtered (vector)</term>
0383 <listitem>
0384 <para>
0385 The array of filtered data values.
0386 </para>
0387 </listitem>
0388 </varlistentry>
0389 
0390 </variablelist>
0391 </sect3>
0392 
0393 </sect2>
0394 
0395 <sect2 id="plugin-butterworth_lowpass">
0396 <title>Butterworth low-pass</title>
0397 <para>
0398 The Butterworth low-pass plugin filters a set of data by calculating
0399 the Fourier transform of the data and recalculating the
0400 the frequency responses using the following formula
0401 </para>
0402 <para>
0403 <inlinemediaobject>
0404 <imageobject>
0405 <imagedata fileref="Formula-kst-lowpass.png" format="PNG" />
0406 </imageobject>
0407 <textobject>
0408 <phrase>Autocorrelation formula</phrase>
0409 </textobject>
0410 </inlinemediaobject>
0411 </para>
0412 <para>
0413 where <literal>f</literal> is the frequency, <literal>f<subscript>c</subscript></literal> is
0414 the low frequency cutoff, and
0415 <literal>n</literal> is the order of the Butterworth filter.  The inverse Fourier transform
0416 is then calculated using the new filtered frequency responses.
0417 </para>
0418 <sect3 id="plugin-butterworth_lowpass-inputs">
0419 <title>Inputs</title>
0420 <variablelist>
0421 
0422 <varlistentry>
0423 <term>X Array (vector)</term>
0424 <listitem>
0425 <para>
0426 The array of values to filter.
0427 </para>
0428 </listitem>
0429 </varlistentry>
0430 
0431 <varlistentry>
0432 <term>Order (scalar)</term>
0433 <listitem>
0434 <para>
0435 The order of the Butterworth filter to use.
0436 </para>
0437 </listitem>
0438 </varlistentry>
0439 
0440 <varlistentry>
0441 <term>Cutoff frequency (scalar)</term>
0442 <listitem>
0443 <para>
0444 The cutoff frequency of the Butterworth low pass filter.
0445 </para>
0446 </listitem>
0447 </varlistentry>
0448 
0449 </variablelist>
0450 </sect3>
0451 
0452 <sect3 id="plugin-butterworth_lowpass-outputs">
0453 <title>Outputs</title>
0454 <variablelist>
0455 
0456 <varlistentry>
0457 <term>X Filtered (vector)</term>
0458 <listitem>
0459 <para>
0460 The array of filtered data values.
0461 </para>
0462 </listitem>
0463 </varlistentry>
0464 
0465 </variablelist>
0466 </sect3>
0467 
0468 </sect2>
0469 
0470 
0471 
0472 
0473 <sect2 id="plugin-chop">
0474 <title>Chop</title>
0475 <para>
0476 The chop plugin takes an input vector and divides it into two vectors.  Every second element in the
0477 input vector is placed in one output vector, while all other elements from the input vector are placed
0478 in another output vector.
0479 </para>
0480 
0481 <sect3 id="plugin-chop-inputs">
0482 <title>Inputs</title>
0483 <variablelist>
0484 
0485 <varlistentry>
0486 <term>Array (vector)</term>
0487 <listitem>
0488 <para>
0489 The array of values to perform the chop on.
0490 </para>
0491 </listitem>
0492 </varlistentry>
0493 
0494 </variablelist>
0495 </sect3>
0496 
0497 <sect3 id="plugin-chop-outputs">
0498 <title>Outputs</title>
0499 <variablelist>
0500 
0501 <varlistentry>
0502 <term>Odd Array (vector)</term>
0503 <listitem>
0504 <para>
0505 The array containing the odd part of the input array (i.e. it contains the first element of the
0506 input array).
0507 </para>
0508 </listitem>
0509 </varlistentry>
0510 
0511 <varlistentry>
0512 <term>Even Array (vector)</term>
0513 <listitem>
0514 <para>
0515 The array containing the even part of the input array (i.e. it does not contain the first element
0516 of the input array).
0517 </para>
0518 </listitem>
0519 </varlistentry>
0520 
0521 <varlistentry>
0522 <term>Difference Array (vector)</term>
0523 <listitem>
0524 <para>
0525 The array containing the elements of the odd array minus the respective elements of the even array.
0526 </para>
0527 </listitem>
0528 </varlistentry>
0529 
0530 <varlistentry>
0531 <term>Index Array (vector)</term>
0532 <listitem>
0533 <para>
0534 An index array the same length as the other three output arrays.
0535 </para>
0536 </listitem>
0537 </varlistentry>
0538 
0539 </variablelist>
0540 </sect3>
0541 </sect2>
0542 
0543 <sect2 id="plugin-convolution">
0544 <title>Convolution</title>
0545 <para>
0546 The convolution plugin generates the convolution of one vector with another.  The convolution of two functions
0547 <literal>f</literal> and <literal>g</literal> is given by:
0548 </para>
0549 <para>
0550 <inlinemediaobject>
0551 <imageobject>
0552 <imagedata fileref="Formula-kst-convolution.png" format="PNG"/>
0553 </imageobject>
0554 </inlinemediaobject>
0555 </para>
0556 <para>
0557 The order of the vectors does not matter, since <literal>f*g=g*f</literal>.  In addition,
0558 the vectors do not need to be of the same size,
0559 as the plugin will automatically extrapolate the smaller vector.
0560 </para>
0561 <sect3 id="plugin-convolution-inputs">
0562 <title>Inputs</title>
0563 <variablelist>
0564 
0565 <varlistentry>
0566 <term>Array One (vector)</term>
0567 <listitem>
0568 <para>
0569 One of the pair of arrays to take the convolution of.
0570 </para>
0571 </listitem>
0572 </varlistentry>
0573 
0574 <varlistentry>
0575 <term>Array Two (vector)</term>
0576 <listitem>
0577 <para>
0578 One of the pair of arrays to take the convolution of.
0579 </para>
0580 </listitem>
0581 </varlistentry>
0582 
0583 </variablelist>
0584 </sect3>
0585 
0586 <sect3 id="plugin-convolution-outputs">
0587 <title>Outputs</title>
0588 <variablelist>
0589 
0590 <varlistentry>
0591 <term>Convolved (vector)</term>
0592 <listitem>
0593 <para>
0594 The convolution of the two input vectors.
0595 </para>
0596 </listitem>
0597 </varlistentry>
0598 </variablelist>
0599 </sect3>
0600 
0601 </sect2>
0602 
0603 
0604 
0605 
0606 <sect2 id="plugin-crosscorrelation">
0607 <title>Crosscorrelation</title>
0608 <para>
0609 The crosscorrelation plugin calculates correlation values between two series (vectors) <literal>x</literal> and
0610 <literal>y</literal>,
0611  using lag values from <literal>floor(-(N-1)/2)</literal> to <literal>floor((N-1)/2)</literal>, where <literal>N</literal>
0612 is the number of elements in the longer vector.  The shorter vector is padded to the length of the
0613 longer vector using <literal>0</literal>s.  The time
0614 vector is not an input as it is assumed that the data is sampled at equal time intervals.  The correlation
0615 value <literal>r</literal> at lag <literal>k</literal> is:
0616 </para>
0617 <para>
0618 <inlinemediaobject>
0619 <imageobject>
0620 <imagedata fileref="Formula-kst-crosscorrelation.png" format="PNG" />
0621 </imageobject>
0622 <textobject>
0623 <phrase>crosscorrelation formula</phrase>
0624 </textobject>
0625 </inlinemediaobject>
0626 </para>
0627 
0628 <sect3 id="plugin-crosscorrelation-inputs">
0629 <title>Inputs</title>
0630 <variablelist>
0631 
0632 <varlistentry>
0633 <term>X Array (vector)</term>
0634 <listitem>
0635 <para>
0636 The array <literal>x</literal> used in the cross-correlation formula.
0637 </para>
0638 </listitem>
0639 </varlistentry>
0640 
0641 <varlistentry>
0642 <term>Y Array (vector)</term>
0643 <listitem>
0644 <para>
0645 The array <literal>y</literal> used in the cross-correlation formula.
0646 </para>
0647 </listitem>
0648 </varlistentry>
0649 
0650 </variablelist>
0651 </sect3>
0652 
0653 <sect3 id="plugin-crosscorrelation-outputs">
0654 <title>Outputs</title>
0655 <variablelist>
0656 
0657 <varlistentry>
0658 <term>Step Number (vector)</term>
0659 <listitem>
0660 <para>
0661 The array of step, or lag values.
0662 </para>
0663 </listitem>
0664 </varlistentry>
0665 
0666 <varlistentry>
0667 <term>Correlation Value (vector)</term>
0668 <listitem>
0669 <para>
0670 The array of correlation values calculated using the corresponding step number in the Step Number vector.
0671 </para>
0672 </listitem>
0673 </varlistentry>
0674 
0675 </variablelist>
0676 </sect3>
0677 
0678 </sect2>
0679 
0680 
0681 <sect2 id="plugin-deconvolution">
0682 <title>Deconvolution</title>
0683 <para>
0684 The deconvolution plugin generates the deconvolution of one vector with another.  Deconvolution is the inverse of
0685 convolution.  Given the convolved vector <literal>h</literal> and another vector <literal>g</literal>, the deconvolution
0686 <literal>f</literal> is given by:
0687 </para>
0688 <para>
0689 <inlinemediaobject>
0690 <imageobject>
0691 <imagedata fileref="Formula-kst-deconvolution.png" format="PNG"/>
0692 </imageobject>
0693 </inlinemediaobject>
0694 </para>
0695 <para>
0696 The vectors do not need to be of the same size,
0697 as the plugin will automatically extrapolate the shorter vector.  The shorter vector is assumed to be the
0698 response function <literal>g</literal>.
0699 </para>
0700 <sect3 id="plugin-deconvolution-inputs">
0701 <title>Inputs</title>
0702 <variablelist>
0703 
0704 <varlistentry>
0705 <term>Array One (vector)</term>
0706 <listitem>
0707 <para>
0708 One of the pair of arrays to take the deconvolution of.
0709 </para>
0710 </listitem>
0711 </varlistentry>
0712 
0713 <varlistentry>
0714 <term>Array Two (vector)</term>
0715 <listitem>
0716 <para>
0717 One of the pair of arrays to take the deconvolution of.
0718 </para>
0719 </listitem>
0720 </varlistentry>
0721 
0722 </variablelist>
0723 </sect3>
0724 
0725 <sect3 id="plugin-deconvolution-outputs">
0726 <title>Outputs</title>
0727 <variablelist>
0728 
0729 <varlistentry>
0730 <term>Deconvolved (vector)</term>
0731 <listitem>
0732 <para>
0733 The deconvolution of the two input vectors.
0734 </para>
0735 </listitem>
0736 </varlistentry>
0737 </variablelist>
0738 </sect3>
0739 
0740 </sect2>
0741 
0742 
0743 <sect2 id="plugin-kstfit_exponential_weighted">
0744 <title>Fit exponential weighted</title>
0745 <para>
0746 The Fit exponential weighted plugin performs a weighted non-linear least-squares fit
0747 to an exponential model:
0748 </para>
0749 <para>
0750 <inlinemediaobject>
0751 <imageobject>
0752 <imagedata fileref="Formula-kst-exponentialfitequation.png" format="PNG"/>
0753 </imageobject>
0754 </inlinemediaobject>
0755 </para>
0756 
0757 
0758 <para>
0759 An initial estimate of
0760 <literal>a=1.0</literal>,
0761 <inlinemediaobject>
0762 <imageobject>
0763 <imagedata fileref="Symbol-kst-lambda.png" format="PNG"/>
0764 </imageobject>
0765 </inlinemediaobject><literal>=0</literal>, and
0766 <literal>b=0</literal> is used. The plugin subsequently iterates to the solution
0767 until a precision of <literal>1.0e-4</literal> is reached or 500 iterations have been performed.
0768 </para>
0769 
0770 <sect3 id="plugin-kstfit_exponential_weighted-inputs">
0771 <title>Inputs</title>
0772 
0773 <variablelist>
0774 
0775 <varlistentry>
0776 <term>X Array (vector)</term>
0777 <listitem>
0778 <para>
0779 The array of x values for the data points to be fitted.
0780 </para>
0781 </listitem>
0782 </varlistentry>
0783 
0784 <varlistentry>
0785 <term>Y Array (vector)</term>
0786 <listitem>
0787 <para>
0788 The array of y values for the data points to be fitted.
0789 </para>
0790 </listitem>
0791 </varlistentry>
0792 
0793 <varlistentry>
0794 <term>Weights (vector)</term>
0795 <listitem>
0796 <para>
0797 The array of weights to use for the fit.
0798 </para>
0799 </listitem>
0800 </varlistentry>
0801 </variablelist>
0802 </sect3>
0803 
0804 <sect3 id="plugin-kstfit_exponential_weighted-outputs">
0805 <title>Outputs</title>
0806 
0807 <variablelist>
0808 
0809 <varlistentry>
0810 <term>Y Fitted (vector)</term>
0811 <listitem>
0812 <para>
0813 The array of fitted y values.
0814 </para>
0815 </listitem>
0816 </varlistentry>
0817 
0818 <varlistentry>
0819 <term>Residuals (vector)</term>
0820 <listitem>
0821 <para>
0822 The array of residuals.
0823 </para>
0824 </listitem>
0825 </varlistentry>
0826 
0827 <varlistentry>
0828 <term>Parameters (vector)</term>
0829 <listitem>
0830 <para>
0831 The best fit parameters <literal>a</literal>,
0832 <inlinemediaobject>
0833 <imageobject>
0834 <imagedata fileref="Symbol-kst-lambda.png" format="PNG"/>
0835 </imageobject>
0836 </inlinemediaobject>, and
0837 <literal>b</literal>.
0838 </para>
0839 </listitem>
0840 </varlistentry>
0841 
0842 <varlistentry>
0843 <term>Covariance (vector)</term>
0844 <listitem>
0845 <para>
0846 The covariance matrix of the model parameters, returned row after row in the vector.
0847 </para>
0848 </listitem>
0849 </varlistentry>
0850 
0851 <varlistentry>
0852 <term>chi^2/nu (scalar)</term>
0853 <listitem>
0854 <para>
0855 The weighted sum of squares of the residuals, divided by the degrees of freedom.
0856 </para>
0857 </listitem>
0858 </varlistentry>
0859 
0860 </variablelist>
0861 </sect3>
0862 
0863 </sect2>
0864 
0865 <sect2 id="plugin-kstfit_exponential_unweighted">
0866 <title>Fit exponential</title>
0867 <para>
0868 The Fit exponential plugin is identical in function to the
0869 <link linkend="plugin-kstfit_exponential_weighted">Fit exponential weighted</link>
0870 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
0871 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
0872 Weights (vector) input does not exist.
0873 </para>
0874 </sect2>
0875 
0876 <sect2 id="plugin-kstfit_gaussian_weighted">
0877 <title>Fit gaussian weighted</title>
0878 <para>
0879 The Fit gaussian weighted plugin performs a weighted non-linear least-squares fit
0880 to a Gaussian model:
0881 </para>
0882 <para>
0883 <inlinemediaobject>
0884 <imageobject>
0885 <imagedata fileref="Formula-kst-gaussianfitequation.png" format="PNG"/>
0886 </imageobject>
0887 </inlinemediaobject>
0888 </para>
0889 
0890 <para>
0891 An initial estimate of
0892 <literal>a=</literal>(maximum of the y values),
0893 <inlinemediaobject>
0894 <imageobject>
0895 <imagedata fileref="Symbol-kst-mu.png" format="PNG"/>
0896 </imageobject>
0897 </inlinemediaobject><literal>=</literal>(mean of the x values), and
0898 <inlinemediaobject>
0899 <imageobject>
0900 <imagedata fileref="Symbol-kst-sigma.png" format="PNG"/>
0901 </imageobject>
0902 </inlinemediaobject><literal>=</literal>(the midpoint of the x values)
0903 is used. The plugin subsequently iterates to the solution
0904 until a precision of <literal>1.0e-4</literal> is reached or 500 iterations have been performed.
0905 </para>
0906 
0907 <sect3 id="plugin-kstfit_gaussian_weighted-inputs">
0908 <title>Inputs</title>
0909 
0910 <variablelist>
0911 
0912 <varlistentry>
0913 <term>X Array (vector)</term>
0914 <listitem>
0915 <para>
0916 The array of x values for the data points to be fitted.
0917 </para>
0918 </listitem>
0919 </varlistentry>
0920 
0921 <varlistentry>
0922 <term>Y Array (vector)</term>
0923 <listitem>
0924 <para>
0925 The array of y values for the data points to be fitted.
0926 </para>
0927 </listitem>
0928 </varlistentry>
0929 
0930 <varlistentry>
0931 <term>Weights (vector)</term>
0932 <listitem>
0933 <para>
0934 The array of weights to use for the fit.
0935 </para>
0936 </listitem>
0937 </varlistentry>
0938 </variablelist>
0939 </sect3>
0940 
0941 <sect3 id="plugin-kstfit_gaussian_weighted-outputs">
0942 <title>Outputs</title>
0943 
0944 <variablelist>
0945 
0946 <varlistentry>
0947 <term>Y Fitted (vector)</term>
0948 <listitem>
0949 <para>
0950 The array of fitted y values.
0951 </para>
0952 </listitem>
0953 </varlistentry>
0954 
0955 <varlistentry>
0956 <term>Residuals (vector)</term>
0957 <listitem>
0958 <para>
0959 The array of residuals.
0960 </para>
0961 </listitem>
0962 </varlistentry>
0963 
0964 <varlistentry>
0965 <term>Parameters (vector)</term>
0966 <listitem>
0967 <para>
0968 The best fit parameters
0969 <inlinemediaobject>
0970 <imageobject>
0971 <imagedata fileref="Symbol-kst-mu.png" format="PNG"/>
0972 </imageobject>
0973 </inlinemediaobject>,
0974 <inlinemediaobject>
0975 <imageobject>
0976 <imagedata fileref="Symbol-kst-sigma.png" format="PNG"/>
0977 </imageobject>
0978 </inlinemediaobject>, and
0979 <literal>a</literal>.
0980 </para>
0981 </listitem>
0982 </varlistentry>
0983 
0984 <varlistentry>
0985 <term>Covariance (vector)</term>
0986 <listitem>
0987 <para>
0988 The covariance matrix of the model parameters, returned row after row in the vector.
0989 </para>
0990 </listitem>
0991 </varlistentry>
0992 
0993 <varlistentry>
0994 <term>chi^2/nu (scalar)</term>
0995 <listitem>
0996 <para>
0997 The weighted sum of squares of the residuals, divided by the degrees of freedom.
0998 </para>
0999 </listitem>
1000 </varlistentry>
1001 
1002 </variablelist>
1003 </sect3>
1004 
1005 </sect2>
1006 
1007 <sect2 id="plugin-kstfit_gaussian_unweighted">
1008 <title>Fit gaussian</title>
1009 <para>
1010 The Fit gaussian plugin is identical in function to the
1011 <link linkend="plugin-kstfit_gaussian_weighted">Fit gaussian weighted</link>
1012 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1013 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1014 Weights (vector) input does not exist.
1015 </para>
1016 </sect2>
1017 
1018 
1019 <sect2 id="plugin-kstfit_gradient_weighted">
1020 <title>Fit gradient weighted</title>
1021 <para>
1022 The gradient weighted plugin performs a weighted least-squares fit to a straight line
1023 model without a constant term:
1024 </para>
1025 <para>
1026 <inlinemediaobject>
1027 <imageobject>
1028 <imagedata fileref="Formula-kst-gradientequation.png" format="PNG"/>
1029 </imageobject>
1030 </inlinemediaobject>
1031 </para>
1032 <para>
1033 The best-fit is found by minimizing the weighted sum of squared residuals:
1034 </para>
1035 <para>
1036 <inlinemediaobject>
1037 <imageobject>
1038 <imagedata fileref="Formula-kst-gradientsumofsquares.png" format="PNG"/>
1039 </imageobject>
1040 </inlinemediaobject>
1041 </para>
1042 <para>
1043 for <literal>b</literal>,
1044 where <literal>w<subscript>i</subscript></literal> is the weight at index <literal>i</literal>.
1045 </para>
1046 <sect3 id="plugin-kstfit_gradient_weighted-inputs">
1047 <title>Inputs</title>
1048 <variablelist>
1049 
1050 <varlistentry>
1051 <term>X Array (vector)</term>
1052 <listitem>
1053 <para>
1054 The array of x values for the data points to be fitted.
1055 </para>
1056 </listitem>
1057 </varlistentry>
1058 
1059 <varlistentry>
1060 <term>Y Array (vector)</term>
1061 <listitem>
1062 <para>
1063 The array of y values for the data points to be fitted.
1064 </para>
1065 </listitem>
1066 </varlistentry>
1067 
1068 <varlistentry>
1069 <term>Weights (vector)</term>
1070 <listitem>
1071 <para>
1072 The array containing weights to be used for the fit.
1073 </para>
1074 </listitem>
1075 </varlistentry>
1076 
1077 </variablelist>
1078 </sect3>
1079 
1080 <sect3 id="plugin-kstfit_gradient_weighted-outputs">
1081 <title>Outputs</title>
1082 <variablelist>
1083 <varlistentry>
1084 <term>Y Fitted (vector)</term>
1085 <listitem>
1086 <para>
1087 The array of y values for the points representing the best-fit line.
1088 </para>
1089 </listitem>
1090 </varlistentry>
1091 
1092 <varlistentry>
1093 <term>Residuals (vector)</term>
1094 <listitem>
1095 <para>
1096 The array of residuals, or differences between the y values of the best-fit line and the y values
1097 of the data points.
1098 </para>
1099 </listitem>
1100 </varlistentry>
1101 
1102 <varlistentry>
1103 <term>Parameters (vector)</term>
1104 <listitem>
1105 <para>
1106 The parameter <literal>b</literal> of the best-fit.
1107 </para>
1108 </listitem>
1109 </varlistentry>
1110 
1111 <varlistentry>
1112 <term>Covariance (vector)</term>
1113 <listitem>
1114 <para>
1115 The estimated covariance matrix, returned row after row, starting with row 0.
1116 </para>
1117 </listitem>
1118 </varlistentry>
1119 
1120 <varlistentry>
1121 <term>Y Lo (vector)</term>
1122 <listitem>
1123 <para>
1124 The corresponding value in Y Fitted minus the standard deviation of the best-fit function at
1125 the corresponding x value.
1126 </para>
1127 </listitem>
1128 </varlistentry>
1129 
1130 <varlistentry>
1131 <term>Y Hi (vector)</term>
1132 <listitem>
1133 <para>
1134 The corresponding value in Y Fitted plus the standard deviation of the best-fit function at
1135 the corresponding x value.
1136 </para>
1137 </listitem>
1138 </varlistentry>
1139 
1140 <varlistentry>
1141 <term>chi^2/nu (scalar)</term>
1142 <listitem>
1143 <para>
1144 The value of the sum of squares of the residuals, divided by the degrees of freedom.
1145 </para>
1146 </listitem>
1147 </varlistentry>
1148 
1149 
1150 </variablelist>
1151 </sect3>
1152 </sect2>
1153 
1154 <sect2 id="plugin-kstfit_gradient_unweighted">
1155 <title>Fit gradient</title>
1156 <para>
1157 The Fit linear plugin is identical in function to the
1158 <link linkend="plugin-kstfit_gradient_weighted">Fit gradient weighted</link>
1159 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1160 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1161 Weights (vector) input does not exist.
1162 </para>
1163 </sect2>
1164 
1165 
1166 
1167 <sect2 id="plugin-kstfit_linear_weighted">
1168 <title>Fit linear weighted</title>
1169 <para>
1170 The Fit linear weighted plugin performs a weighted least-squares fit to a straight line model:
1171 </para>
1172 <para>
1173 <inlinemediaobject>
1174 <imageobject>
1175 <imagedata fileref="Formula-kst-linefitequation.png" format="PNG"/>
1176 </imageobject>
1177 </inlinemediaobject>
1178 </para>
1179 <para>
1180 The best-fit is found by minimizing the weighted sum of squared residuals:
1181 </para>
1182 <para>
1183 <inlinemediaobject>
1184 <imageobject>
1185 <imagedata fileref="Formula-kst-linefitsumofsquaredresiduals.png" format="PNG"/>
1186 </imageobject>
1187 </inlinemediaobject>
1188 </para>
1189 <para>
1190 for <literal>a</literal> and <literal>b</literal>,
1191 where <literal>w<subscript>i</subscript></literal> is the weight at index <literal>i</literal>.
1192 </para>
1193 <sect3 id="plugin-kstfit_linear_weighted-inputs">
1194 <title>Inputs</title>
1195 <variablelist>
1196 
1197 <varlistentry>
1198 <term>X Array (vector)</term>
1199 <listitem>
1200 <para>
1201 The array of x values for the data points to be fitted.
1202 </para>
1203 </listitem>
1204 </varlistentry>
1205 
1206 <varlistentry>
1207 <term>Y Array (vector)</term>
1208 <listitem>
1209 <para>
1210 The array of y values for the data points to be fitted.
1211 </para>
1212 </listitem>
1213 </varlistentry>
1214 
1215 <varlistentry>
1216 <term>Weights (vector)</term>
1217 <listitem>
1218 <para>
1219 The array containing weights to be used for the fit.
1220 </para>
1221 </listitem>
1222 </varlistentry>
1223 
1224 </variablelist>
1225 </sect3>
1226 
1227 <sect3 id="plugin-kstfit_linear_weighted-outputs">
1228 <title>Outputs</title>
1229 <variablelist>
1230 
1231 <varlistentry>
1232 <term>Y Fitted (vector)</term>
1233 <listitem>
1234 <para>
1235 The array of y values for the points representing the best-fit line.
1236 </para>
1237 </listitem>
1238 </varlistentry>
1239 
1240 <varlistentry>
1241 <term>Residuals (vector)</term>
1242 <listitem>
1243 <para>
1244 The array of residuals, or differences between the y values of the best-fit line and the y values
1245 of the data points.
1246 </para>
1247 </listitem>
1248 </varlistentry>
1249 
1250 <varlistentry>
1251 <term>Parameters (vector)</term>
1252 <listitem>
1253 <para>
1254 The parameters <literal>a</literal> and <literal>b</literal> of the best-fit.
1255 </para>
1256 </listitem>
1257 </varlistentry>
1258 
1259 <varlistentry>
1260 <term>Covariance (vector)</term>
1261 <listitem>
1262 <para>
1263 The estimated covariance matrix, returned row after row, starting with row 0.
1264 </para>
1265 </listitem>
1266 </varlistentry>
1267 
1268 <varlistentry>
1269 <term>Y Lo (vector)</term>
1270 <listitem>
1271 <para>
1272 The corresponding value in Y Fitted minus the standard deviation of the best-fit function at
1273 the corresponding x value.
1274 </para>
1275 </listitem>
1276 </varlistentry>
1277 
1278 <varlistentry>
1279 <term>Y Hi (vector)</term>
1280 <listitem>
1281 <para>
1282 The corresponding value in Y Fitted plus the standard deviation of the best-fit function at
1283 the corresponding x value.
1284 </para>
1285 </listitem>
1286 </varlistentry>
1287 
1288 <varlistentry>
1289 <term>chi^2/nu (scalar)</term>
1290 <listitem>
1291 <para>
1292 The value of the sum of squares of the residuals, divided by the degrees of freedom.
1293 </para>
1294 </listitem>
1295 </varlistentry>
1296 
1297 
1298 </variablelist>
1299 </sect3>
1300 </sect2>
1301 
1302 <sect2 id="plugin-kstfit_linear_unweighted">
1303 <title>Fit linear</title>
1304 <para>
1305 The Fit linear plugin is identical in function to the
1306 <link linkend="plugin-kstfit_linear_weighted">Fit linear weighted</link>
1307 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1308 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1309 Weights (vector) input does not exist.
1310 </para>
1311 </sect2>
1312 
1313 
1314 <sect2 id="plugin-kstfit_lorentzian_weighted">
1315 <title>Fit lorentzian weighted</title>
1316 <para>
1317 The Fit lorentzian weighted plugin performs a weighted non-linear least-squares fit
1318 to a Lorentzian model:
1319 </para>
1320 <para>
1321 <inlinemediaobject>
1322 <imageobject>
1323 <imagedata fileref="Formula-kst-lorentzianfitequation.png" format="PNG"/>
1324 </imageobject>
1325 </inlinemediaobject>
1326 </para>
1327 
1328 <para>
1329 An initial estimate of
1330 <literal>a=</literal>(maximum of the y values),
1331 <literal>x<subscript>0</subscript>=</literal>(mean of the x values), and
1332 <inlinemediaobject>
1333 <imageobject>
1334 <imagedata fileref="Symbol-kst-Gamma.png" format="PNG"/>
1335 </imageobject>
1336 </inlinemediaobject><literal>=</literal>(the midpoint of the x values)
1337 is used. The plugin subsequently iterates to the solution
1338 until a precision of <literal>1.0e-4</literal> is reached or 500 iterations have been performed.
1339 </para>
1340 
1341 <sect3 id="plugin-kstfit_lorentzian_weighted-inputs">
1342 <title>Inputs</title>
1343 
1344 <variablelist>
1345 
1346 <varlistentry>
1347 <term>X Array (vector)</term>
1348 <listitem>
1349 <para>
1350 The array of x values for the data points to be fitted.
1351 </para>
1352 </listitem>
1353 </varlistentry>
1354 
1355 <varlistentry>
1356 <term>Y Array (vector)</term>
1357 <listitem>
1358 <para>
1359 The array of y values for the data points to be fitted.
1360 </para>
1361 </listitem>
1362 </varlistentry>
1363 
1364 <varlistentry>
1365 <term>Weights (vector)</term>
1366 <listitem>
1367 <para>
1368 The array of weights to use for the fit.
1369 </para>
1370 </listitem>
1371 </varlistentry>
1372 </variablelist>
1373 </sect3>
1374 
1375 <sect3 id="plugin-kstfit_lorentzian_weighted-outputs">
1376 <title>Outputs</title>
1377 
1378 <variablelist>
1379 
1380 <varlistentry>
1381 <term>Y Fitted (vector)</term>
1382 <listitem>
1383 <para>
1384 The array of fitted y values.
1385 </para>
1386 </listitem>
1387 </varlistentry>
1388 
1389 <varlistentry>
1390 <term>Residuals (vector)</term>
1391 <listitem>
1392 <para>
1393 The array of residuals.
1394 </para>
1395 </listitem>
1396 </varlistentry>
1397 
1398 <varlistentry>
1399 <term>Parameters (vector)</term>
1400 <listitem>
1401 <para>
1402 The best fit parameters
1403 <literal>x<subscript>0</subscript></literal>,
1404 <inlinemediaobject>
1405 <imageobject>
1406 <imagedata fileref="Symbol-kst-Gamma.png" format="PNG"/>
1407 </imageobject>
1408 </inlinemediaobject>, and
1409 <literal>a</literal>.
1410 </para>
1411 </listitem>
1412 </varlistentry>
1413 
1414 <varlistentry>
1415 <term>Covariance (vector)</term>
1416 <listitem>
1417 <para>
1418 The covariance matrix of the model parameters, returned row after row in the vector.
1419 </para>
1420 </listitem>
1421 </varlistentry>
1422 
1423 <varlistentry>
1424 <term>chi^2/nu (scalar)</term>
1425 <listitem>
1426 <para>
1427 The weighted sum of squares of the residuals, divided by the degrees of freedom.
1428 </para>
1429 </listitem>
1430 </varlistentry>
1431 
1432 </variablelist>
1433 </sect3>
1434 
1435 </sect2>
1436 
1437 <sect2 id="plugin-kstfit_lorentzian_unweighted">
1438 <title>Fit lorentzian</title>
1439 <para>
1440 The Fit lorentzian plugin is identical in function to the
1441 <link linkend="plugin-kstfit_lorentzian_weighted">Fit lorentzian weighted</link>
1442 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1443 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1444 Weights (vector) input does not exist.
1445 </para>
1446 </sect2>
1447 
1448 
1449 <sect2 id="plugin-kstfit_polynomial_weighted">
1450 <title>Fit polynomial weighted</title>
1451 <para>
1452 The Fit polynomial weighted plugin performs a weighted least-squares fit to a polynomial model:
1453 </para>
1454 <para>
1455 <inlinemediaobject>
1456 <imageobject>
1457 <imagedata fileref="Formula-kst-polynomialfitequation.png" format="PNG"/>
1458 </imageobject>
1459 </inlinemediaobject>
1460 </para>
1461 <para>
1462 where <literal>n</literal> is the degree of the polynomial model.
1463 </para>
1464 
1465 <sect3 id="plugin-kstfit_polynomial_weighted-inputs">
1466 <title>Inputs</title>
1467 
1468 <variablelist>
1469 
1470 <varlistentry>
1471 <term>X Array (vector)</term>
1472 <listitem>
1473 <para>
1474 The array of x values for the data points to be fitted.
1475 </para>
1476 </listitem>
1477 </varlistentry>
1478 
1479 <varlistentry>
1480 <term>Y Array (vector)</term>
1481 <listitem>
1482 <para>
1483 The array of y values for the data points to be fitted.
1484 </para>
1485 </listitem>
1486 </varlistentry>
1487 
1488 <varlistentry>
1489 <term>Weights (vector)</term>
1490 <listitem>
1491 <para>
1492 The array of weights to use for the fit.
1493 </para>
1494 </listitem>
1495 </varlistentry>
1496 
1497 <varlistentry>
1498 <term>Order (scalar)</term>
1499 <listitem>
1500 <para>
1501 The order, or degree, of the polynomial model to use.
1502 </para>
1503 </listitem>
1504 </varlistentry>
1505 
1506 </variablelist>
1507 </sect3>
1508 
1509 <sect3 id="plugin-kstfit_polynomial_weighted-outputs">
1510 <title>Outputs</title>
1511 
1512 <variablelist>
1513 
1514 <varlistentry>
1515 <term>Y Fitted (vector)</term>
1516 <listitem>
1517 <para>
1518 The array of fitted y values.
1519 </para>
1520 </listitem>
1521 </varlistentry>
1522 
1523 <varlistentry>
1524 <term>Residuals (vector)</term>
1525 <listitem>
1526 <para>
1527 The array of residuals.
1528 </para>
1529 </listitem>
1530 </varlistentry>
1531 
1532 <varlistentry>
1533 <term>Parameters (vector)</term>
1534 <listitem>
1535 <para>
1536 The best fit parameters <literal>c<subscript>0</subscript></literal>,
1537 <literal>c<subscript>1</subscript></literal>,...,
1538 <literal>c<subscript>n</subscript></literal>.
1539 </para>
1540 </listitem>
1541 </varlistentry>
1542 
1543 <varlistentry>
1544 <term>Covariance (vector)</term>
1545 <listitem>
1546 <para>
1547 The covariance matrix of the model parameters, returned row after row in the vector.
1548 </para>
1549 </listitem>
1550 </varlistentry>
1551 
1552 <varlistentry>
1553 <term>chi^2/nu (scalar)</term>
1554 <listitem>
1555 <para>
1556 The weighted sum of squares of the residuals, divided by the degrees of freedom.
1557 </para>
1558 </listitem>
1559 </varlistentry>
1560 
1561 </variablelist>
1562 </sect3>
1563 </sect2>
1564 
1565 <sect2 id="plugin-kstfit_polynomial_unweighted">
1566 <title>Fit polynomial</title>
1567 <para>
1568 The Fit polynomial plugin is identical in function to the
1569 <link linkend="plugin-kstfit_polynomial_weighted">Fit polynomial weighted</link>
1570 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1571 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1572 Weights (vector) input does not exist.
1573 </para>
1574 </sect2>
1575 
1576 
1577 <sect2 id="plugin-kstfit_sinusoid_weighted">
1578 <title>Fit sinusoid weighted</title>
1579 <para>
1580 The Fit sinusoid weighted plugin performs a least-squares fit to a sinusoid model:
1581 </para>
1582 <para>
1583 <inlinemediaobject>
1584 <imageobject>
1585 <imagedata fileref="Formula-kst-sinusoidfitequation.png" format="PNG"/>
1586 </imageobject>
1587 </inlinemediaobject>
1588 </para>
1589 <para>
1590 where <literal>T</literal> is the specified period,
1591 and <literal>n=2+2H</literal>, where
1592 <literal>H</literal> is the specified number of harmonics.
1593 </para>
1594 
1595 <sect3 id="plugin-kstfit_sinusoid_weighted-inputs">
1596 <title>Inputs</title>
1597 
1598 <variablelist>
1599 
1600 <varlistentry>
1601 <term>X Array (vector)</term>
1602 <listitem>
1603 <para>
1604 The array of x values for the data points to be fitted.
1605 </para>
1606 </listitem>
1607 </varlistentry>
1608 
1609 <varlistentry>
1610 <term>Y Array (vector)</term>
1611 <listitem>
1612 <para>
1613 The array of y values for the data points to be fitted.
1614 </para>
1615 </listitem>
1616 </varlistentry>
1617 
1618 <varlistentry>
1619 <term>Weights (vector)</term>
1620 <listitem>
1621 <para>
1622 The array of weights to use for the fit.
1623 </para>
1624 </listitem>
1625 </varlistentry>
1626 
1627 <varlistentry>
1628 <term>Harmonics (scalar)</term>
1629 <listitem>
1630 <para>
1631 The number of harmonics of the sinusoid to fit.
1632 </para>
1633 </listitem>
1634 </varlistentry>
1635 
1636 <varlistentry>
1637 <term>Period (scalar)</term>
1638 <listitem>
1639 <para>
1640 The period of the sinusoid to fit.
1641 </para>
1642 </listitem>
1643 </varlistentry>
1644 
1645 </variablelist>
1646 </sect3>
1647 
1648 <sect3 id="plugin-kstfit_sinusoid_weighted-outputs">
1649 <title>Outputs</title>
1650 
1651 <variablelist>
1652 
1653 <varlistentry>
1654 <term>Y Fitted (vector)</term>
1655 <listitem>
1656 <para>
1657 The array of fitted y values.
1658 </para>
1659 </listitem>
1660 </varlistentry>
1661 
1662 <varlistentry>
1663 <term>Residuals (vector)</term>
1664 <listitem>
1665 <para>
1666 The array of residuals.
1667 </para>
1668 </listitem>
1669 </varlistentry>
1670 
1671 <varlistentry>
1672 <term>Parameters (vector)</term>
1673 <listitem>
1674 <para>
1675 The best fit parameters <literal>c<subscript>0</subscript></literal>,
1676 <literal>c<subscript>1</subscript></literal>,...,
1677 <literal>c<subscript>n</subscript></literal>.
1678 </para>
1679 </listitem>
1680 </varlistentry>
1681 
1682 <varlistentry>
1683 <term>Covariance (vector)</term>
1684 <listitem>
1685 <para>
1686 The covariance matrix of the model parameters, returned row after row in the vector.
1687 </para>
1688 </listitem>
1689 </varlistentry>
1690 
1691 <varlistentry>
1692 <term>chi^2/nu (scalar)</term>
1693 <listitem>
1694 <para>
1695 The weighted sum of squares of the residuals, divided by the degrees of freedom.
1696 </para>
1697 </listitem>
1698 </varlistentry>
1699 
1700 </variablelist>
1701 </sect3>
1702 </sect2>
1703 
1704 <sect2 id="plugin-kstfit_sinusoid_unweighted">
1705 <title>Fit sinusoid</title>
1706 <para>
1707 The Fit sinusoid plugin is identical in function to the
1708 <link linkend="plugin-kstfit_sinusoid_weighted">Fit sinusoid weighted</link>
1709 plugin with the exception that the weight value <literal>w<subscript>i</subscript></literal>
1710 is equal to <literal>1</literal> for all index values <literal>i</literal>.  As a result, the
1711 Weights (vector) input does not exist.
1712 </para>
1713 </sect2>
1714 
1715 
1716 
1717 
1718 
1719 
1720 <sect2 id="plugin-kstinterp_akima">
1721 <title>Interpolation Akima spline</title>
1722 <para>
1723 The Interpolation Akima spline plugin generates a non-rounded Akima spline interpolation for the supplied data set,
1724 using natural boundary conditions.
1725 </para>
1726 
1727 <sect3 id="plugin-kstinterp_akima-inputs">
1728 <title>Inputs</title>
1729 <variablelist>
1730 
1731 <varlistentry>
1732 <term>X Array (vector)</term>
1733 <listitem>
1734 <para>
1735 The array of x values of the data points to generate the interpolation for.
1736 </para>
1737 </listitem>
1738 </varlistentry>
1739 
1740 
1741 <varlistentry>
1742 <term>Y Array (vector)</term>
1743 <listitem>
1744 <para>
1745 The array of y values of the data points to generate the interpolation for.
1746 </para>
1747 </listitem>
1748 </varlistentry>
1749 
1750 <varlistentry>
1751 <term>X' Array (vector)</term>
1752 <listitem>
1753 <para>
1754 The array of x values for which interpolated y values are desired.
1755 </para>
1756 </listitem>
1757 </varlistentry>
1758 
1759 </variablelist>
1760 </sect3>
1761 
1762 <sect3 id="plugin-kstinterp_akima-outputs">
1763 <title>Outputs</title>
1764 <variablelist>
1765 
1766 <varlistentry>
1767 <term>Y Interpolated (vector)</term>
1768 <listitem>
1769 <para>
1770 The interpolated y values.
1771 </para>
1772 </listitem>
1773 </varlistentry>
1774 
1775 </variablelist>
1776 </sect3>
1777 </sect2>
1778 
1779 <sect2 id="plugin-kstinterp_akima_periodic">
1780 <title>Interpolation Akima spline periodic</title>
1781 <para>
1782 The kstinterp akima periodic plugin generates a non-rounded Akima spline interpolation for the supplied data set,
1783 using periodic boundary conditions.
1784 </para>
1785 
1786 <sect3 id="plugin-kstinterp_akima_periodic-inputs">
1787 <title>Inputs</title>
1788 <variablelist>
1789 
1790 <varlistentry>
1791 <term>X Array (vector)</term>
1792 <listitem>
1793 <para>
1794 The array of x values of the data points to generate the interpolation for.
1795 </para>
1796 </listitem>
1797 </varlistentry>
1798 
1799 
1800 <varlistentry>
1801 <term>Y Array (vector)</term>
1802 <listitem>
1803 <para>
1804 The array of y values of the data points to generate the interpolation for.
1805 </para>
1806 </listitem>
1807 </varlistentry>
1808 
1809 <varlistentry>
1810 <term>X' Array (vector)</term>
1811 <listitem>
1812 <para>
1813 The array of x values for which interpolated y values are desired.
1814 </para>
1815 </listitem>
1816 </varlistentry>
1817 
1818 </variablelist>
1819 </sect3>
1820 
1821 <sect3 id="plugin-kstinterp_akima_periodic-outputs">
1822 <title>Outputs</title>
1823 <variablelist>
1824 
1825 <varlistentry>
1826 <term>Y Interpolated (vector)</term>
1827 <listitem>
1828 <para>
1829 The interpolated y values.
1830 </para>
1831 </listitem>
1832 </varlistentry>
1833 
1834 </variablelist>
1835 </sect3>
1836 </sect2>
1837 
1838 <sect2 id="plugin-kstinterp_cspline">
1839 <title>Interpolation cubic spline</title>
1840 <para>
1841 The Interpolation cubic spline plugin generates a cubic spline interpolation for the supplied data set,
1842 using natural boundary conditions.
1843 </para>
1844 
1845 <sect3 id="plugin-kstinterp_cspline-inputs">
1846 <title>Inputs</title>
1847 <variablelist>
1848 
1849 <varlistentry>
1850 <term>X Array (vector)</term>
1851 <listitem>
1852 <para>
1853 The array of x values of the data points to generate the interpolation for.
1854 </para>
1855 </listitem>
1856 </varlistentry>
1857 
1858 
1859 <varlistentry>
1860 <term>Y Array (vector)</term>
1861 <listitem>
1862 <para>
1863 The array of y values of the data points to generate the interpolation for.
1864 </para>
1865 </listitem>
1866 </varlistentry>
1867 
1868 <varlistentry>
1869 <term>X' Array (vector)</term>
1870 <listitem>
1871 <para>
1872 The array of x values for which interpolated y values are desired.
1873 </para>
1874 </listitem>
1875 </varlistentry>
1876 
1877 </variablelist>
1878 </sect3>
1879 
1880 <sect3 id="plugin-kstinterp_cspline-outputs">
1881 <title>Outputs</title>
1882 <variablelist>
1883 
1884 <varlistentry>
1885 <term>Y Interpolated (vector)</term>
1886 <listitem>
1887 <para>
1888 The interpolated y values.
1889 </para>
1890 </listitem>
1891 </varlistentry>
1892 
1893 </variablelist>
1894 </sect3>
1895 </sect2>
1896 
1897 <sect2 id="plugin-kstinterp_cspline_periodic">
1898 <title>Interpolation cubic spline periodic</title>
1899 <para>
1900 The Interpolation cubic spline periodic plugin generates a cubic spline interpolation for the supplied data set,
1901 using periodic boundary conditions.
1902 </para>
1903 
1904 <sect3 id="plugin-kstinterp_cspline_periodic-inputs">
1905 <title>Inputs</title>
1906 <variablelist>
1907 
1908 <varlistentry>
1909 <term>X Array (vector)</term>
1910 <listitem>
1911 <para>
1912 The array of x values of the data points to generate the interpolation for.
1913 </para>
1914 </listitem>
1915 </varlistentry>
1916 
1917 
1918 <varlistentry>
1919 <term>Y Array (vector)</term>
1920 <listitem>
1921 <para>
1922 The array of y values of the data points to generate the interpolation for.
1923 </para>
1924 </listitem>
1925 </varlistentry>
1926 
1927 <varlistentry>
1928 <term>X' Array (vector)</term>
1929 <listitem>
1930 <para>
1931 The array of x values for which interpolated y values are desired.
1932 </para>
1933 </listitem>
1934 </varlistentry>
1935 
1936 </variablelist>
1937 </sect3>
1938 
1939 <sect3 id="plugin-kstinterp_cspline_periodic-outputs">
1940 <title>Outputs</title>
1941 <variablelist>
1942 
1943 <varlistentry>
1944 <term>Y Interpolated (vector)</term>
1945 <listitem>
1946 <para>
1947 The interpolated y values.
1948 </para>
1949 </listitem>
1950 </varlistentry>
1951 
1952 </variablelist>
1953 </sect3>
1954 </sect2>
1955 
1956 <sect2 id="plugin-kstinterp_linear">
1957 <title>Interpolation linear</title>
1958 <para>
1959 The Interpolation linear plugin generates a linear interpolation for the supplied data set.
1960 </para>
1961 
1962 <sect3 id="plugin-kstinterp_linear-inputs">
1963 <title>Inputs</title>
1964 <variablelist>
1965 
1966 <varlistentry>
1967 <term>X Array (vector)</term>
1968 <listitem>
1969 <para>
1970 The array of x values of the data points to generate the interpolation for.
1971 </para>
1972 </listitem>
1973 </varlistentry>
1974 
1975 
1976 <varlistentry>
1977 <term>Y Array (vector)</term>
1978 <listitem>
1979 <para>
1980 The array of y values of the data points to generate the interpolation for.
1981 </para>
1982 </listitem>
1983 </varlistentry>
1984 
1985 <varlistentry>
1986 <term>X' Array (vector)</term>
1987 <listitem>
1988 <para>
1989 The array of x values for which interpolated y values are desired.
1990 </para>
1991 </listitem>
1992 </varlistentry>
1993 
1994 </variablelist>
1995 </sect3>
1996 
1997 <sect3 id="plugin-kstinterp_linear-outputs">
1998 <title>Outputs</title>
1999 <variablelist>
2000 
2001 <varlistentry>
2002 <term>Y Interpolated (vector)</term>
2003 <listitem>
2004 <para>
2005 The interpolated y values.
2006 </para>
2007 </listitem>
2008 </varlistentry>
2009 
2010 </variablelist>
2011 </sect3>
2012 </sect2>
2013 
2014 <sect2 id="plugin-kstinterp_polynomial">
2015 <title>Interpolation polynomial</title>
2016 <para>
2017 The Interpolation polynomial plugin generates a polynomial interpolation for the supplied data set.
2018 The number of terms in the polynomial used is equal to the number of points in the supplied
2019 data set.
2020 </para>
2021 
2022 <sect3 id="plugin-kstinterp_polynomial-inputs">
2023 <title>Inputs</title>
2024 <variablelist>
2025 
2026 <varlistentry>
2027 <term>X Array (vector)</term>
2028 <listitem>
2029 <para>
2030 The array of x values of the data points to generate the interpolation for.
2031 </para>
2032 </listitem>
2033 </varlistentry>
2034 
2035 
2036 <varlistentry>
2037 <term>Y Array (vector)</term>
2038 <listitem>
2039 <para>
2040 The array of y values of the data points to generate the interpolation for.
2041 </para>
2042 </listitem>
2043 </varlistentry>
2044 
2045 <varlistentry>
2046 <term>X' Array (vector)</term>
2047 <listitem>
2048 <para>
2049 The array of x values for which interpolated y values are desired.
2050 </para>
2051 </listitem>
2052 </varlistentry>
2053 
2054 </variablelist>
2055 </sect3>
2056 
2057 <sect3 id="plugin-kstinterp_polynomial-outputs">
2058 <title>Outputs</title>
2059 <variablelist>
2060 
2061 <varlistentry>
2062 <term>Y Interpolated (vector)</term>
2063 <listitem>
2064 <para>
2065 The interpolated y values.
2066 </para>
2067 </listitem>
2068 </varlistentry>
2069 
2070 </variablelist>
2071 </sect3>
2072 </sect2>
2073 <sect2 id="plugin-noise-addition">
2074 <title>Noise Addition</title>
2075 <para>
2076 The Noise addition plugin adds a Gaussian random variable to each element of the input vector.
2077 The Gaussian distribution used has a mean of <literal>0</literal> and the specified
2078 standard deviation.  The probability density function of a Gaussian random variable is:
2079 </para>
2080 <para>
2081 <inlinemediaobject>
2082 <imageobject>
2083 <imagedata fileref="Formula-kst-gaussianprobability.png" format="PNG"/>
2084 </imageobject>
2085 </inlinemediaobject>
2086 </para>
2087 
2088 <sect3 id="plugin-noise-addition-inputs">
2089 <title>Inputs</title>
2090 <variablelist>
2091 
2092 <varlistentry>
2093 <term>Array (vector)</term>
2094 <listitem>
2095 <para>
2096 The array of elements to which random noise is to be added.
2097 </para>
2098 </listitem>
2099 </varlistentry>
2100 
2101 
2102 <varlistentry>
2103 <term>Sigma (scalar)</term>
2104 <listitem>
2105 <para>
2106 The standard deviation to use for the Gaussian distribution.
2107 </para>
2108 </listitem>
2109 </varlistentry>
2110 
2111 
2112 </variablelist>
2113 </sect3>
2114 
2115 <sect3 id="plugin-noiseaddition-outputs">
2116 <title>Outputs</title>
2117 <variablelist>
2118 
2119 <varlistentry>
2120 <term>Output Array (vector)</term>
2121 <listitem>
2122 <para>
2123 The array of elements with Gaussian noise added.
2124 </para>
2125 </listitem>
2126 </varlistentry>
2127 
2128 </variablelist>
2129 </sect3>
2130 </sect2>
2131 
2132 <sect2 id="plugin-periodogram">
2133 <title>Periodogram</title>
2134 <para>
2135 The periodogram plugin produces the periodogram of a given data set.  One of two algorithms is used depending on the
2136 size of the data set&mdash;a fast algorithm is used if there are greater than 100 data points, while a slower
2137 algorithm is used if there are less than or equal to 100 data points.
2138 </para>
2139 
2140 <sect3 id="plugin-periodogram-inputs">
2141 <title>Inputs</title>
2142 <variablelist>
2143 
2144 <varlistentry>
2145 <term>Time Array (vector)</term>
2146 <listitem>
2147 <para>
2148 The array of time values of the data points to generate the interpolation for.
2149 </para>
2150 </listitem>
2151 </varlistentry>
2152 
2153 
2154 <varlistentry>
2155 <term>Data Array (vector)</term>
2156 <listitem>
2157 <para>
2158 The array of data values, dependent on the time values,
2159  of the data points to generate the interpolation for.
2160 </para>
2161 </listitem>
2162 </varlistentry>
2163 
2164 <varlistentry>
2165 <term>Oversampling factor (scalar)</term>
2166 <listitem>
2167 <para>
2168 The factor to oversample by.
2169 </para>
2170 </listitem>
2171 </varlistentry>
2172 
2173 <varlistentry>
2174 <term>Average Nyquist frequency factor (scalar)</term>
2175 <listitem>
2176 <para>
2177 The average Nyquist frequency factor.
2178 </para>
2179 </listitem>
2180 </varlistentry>
2181 
2182 </variablelist>
2183 </sect3>
2184 
2185 <sect3 id="plugin-periodogram-outputs">
2186 <title>Outputs</title>
2187 <variablelist>
2188 
2189 <varlistentry>
2190 <term>Frequency (vector)</term>
2191 <listitem>
2192 <para>
2193 The frequency vector.
2194 </para>
2195 </listitem>
2196 </varlistentry>
2197 
2198 <varlistentry>
2199 <term>Periodogram (vector)</term>
2200 <listitem>
2201 <para>
2202 The frequency response vector for the periodogram.
2203 </para>
2204 </listitem>
2205 </varlistentry>
2206 
2207 </variablelist>
2208 </sect3>
2209 </sect2>
2210 
2211 
2212 <sect2 id="plugin-statistics">
2213 <title>Statistics</title>
2214 <para>
2215 The statistics plugin calculates statistics for a given data set.  Most of the output scalars
2216 are named such that the values they represent should be apparent.  Standard formulas are used
2217 to calculate the statistical values.
2218 </para>
2219 
2220 <sect3 id="plugin-statistics-inputs">
2221 <title>Inputs</title>
2222 <variablelist>
2223 
2224 <varlistentry>
2225 <term>Data Array (vector)</term>
2226 <listitem>
2227 <para>
2228 The array of data values to calculate statistics for.
2229 </para>
2230 </listitem>
2231 </varlistentry>
2232 
2233 </variablelist>
2234 </sect3>
2235 
2236 <sect3 id="plugin-statistics-outputs">
2237 <title>Outputs</title>
2238 <variablelist>
2239 <varlistentry>
2240 <term>Mean (scalar)</term>
2241 <listitem>
2242 <para>
2243 The mean of the data values.
2244 </para>
2245 </listitem>
2246 </varlistentry>
2247 
2248 <varlistentry>
2249 <term>Minimum (scalar)</term>
2250 <listitem>
2251 <para>
2252 The minimum value found in the data array.
2253 </para>
2254 </listitem>
2255 </varlistentry>
2256 
2257 <varlistentry>
2258 <term>Maximum (scalar)</term>
2259 <listitem>
2260 <para>
2261 The maximum value found in the data array.
2262 </para>
2263 </listitem>
2264 </varlistentry>
2265 
2266 <varlistentry>
2267 <term>Variance (scalar)</term>
2268 <listitem>
2269 <para>
2270 The variance of the data set.
2271 </para>
2272 </listitem>
2273 </varlistentry>
2274 
2275 <varlistentry>
2276 <term>Standard deviation (scalar)</term>
2277 <listitem>
2278 <para>
2279 The standard deviation of the data set.
2280 </para>
2281 </listitem>
2282 </varlistentry>
2283 
2284 <varlistentry>
2285 <term>Median (scalar)</term>
2286 <listitem>
2287 <para>
2288 The median of the data set.
2289 </para>
2290 </listitem>
2291 </varlistentry>
2292 
2293 <varlistentry>
2294 <term>Absolute deviation (scalar)</term>
2295 <listitem>
2296 <para>
2297 The absolute deviation of the data set.
2298 </para>
2299 </listitem>
2300 </varlistentry>
2301 
2302 <varlistentry>
2303 <term>Skewness (scalar)</term>
2304 <listitem>
2305 <para>
2306 The skewness of the data set.
2307 </para>
2308 </listitem>
2309 </varlistentry>
2310 
2311 
2312 <varlistentry>
2313 <term>Kurtosis (scalar)</term>
2314 <listitem>
2315 <para>
2316 The kurtosis of the data set.
2317 </para>
2318 </listitem>
2319 </varlistentry>
2320 </variablelist>
2321 </sect3>
2322 </sect2>
2323 
2324 <!-- End the long plugins section -->
2325 </sect1>
2326 
2327 </chapter>
2328 
2329 
2330 <!-- Keep this comment at the end of the file
2331 Local variables:
2332 mode: xml
2333 sgml-omittag:nil
2334 sgml-shorttag:nil
2335 sgml-namecase-general:nil
2336 sgml-general-insert-case:lower
2337 sgml-minimize-attributes:nil
2338 sgml-always-quote-attributes:t
2339 sgml-indent-step:0
2340 sgml-indent-data:true
2341 sgml-parent-document:("index.docbook" "book" "chapter")
2342 sgml-exposed-tags:nil
2343 sgml-local-catalogs:nil
2344 sgml-local-ecat-files:nil
2345 End:
2346 -->