Programmer Guide/Command Reference/EVAL/smooth: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====smooth=====
Apply a smoothing to the vector <var>x</var>.
 
;Usage:<code>smooth(<var>x</var> {, <var>type</var>=0 {, <var>m</var>=1 {, <var>s</var>=1}}})</code>
Linear smoothing. Apply linear smoothing to the vector <var>x</var>.
:;<var>x</var>:data vector
 
:;<var>m</var>:smoothing length; 0 < ''m'' <= <code>nrow(''x'')/2</code> (default=1)
=====Usage:=====
:;<var>type</var>:selects the smoothing algorithm (default=0)
 
:;<var>s</var>output step size; 0 < ''s'' <= <code>nrow(''x'')/2</code> (default=1)
<code>smooth(<var>x</var>, 0 {, <var>m</var>, <var>s</var>})</code>
;Description:
 
The smoothing function is selected by the argument ''type''. The smoothed value ''xs''[i] is computed from the data values ''x''[i-m] to ''x''[i+m].  
=====Parameters:=====
{|class="einrahmen"
 
!''type'' !! smoothing algorithm !! ''xs''[i] =
;<var>x</var>
|-
 
|'''0''' || average |
:A data vector.
| (''x''[i-''m''] + .. + x[i] + .. + x[i+''m'']) / (2*''m''+1)
 
|}
;<var>m</var>
;Result: A vector r with <code>nrow(''x'')/s</code> elements. The value ''r''[j] is set to the value ''xs''[j*s] of the smoothed data vector.
 
:The smooth length (<var>m</var><code>>0</code>). The default is <code>1</code>.
 
;<var>s</var>
 
:The sample distance (<var>s</var><code>>0</code>). The default is <code>1</code>.
 
=====Result:=====
 
A vector <code>y</code> where:
 
<code>y[i] = avr(</code><var>x</var><code>[i*</code><var>s</var><code>-</code><var>m</var> <code>.. i*</code><var>s</var><code>+</code><var>m</var><code>])</code>

Revision as of 13:20, 13 April 2011

Apply a smoothing to the vector x.

Usage
smooth(x {, type=0 {, m=1 {, s=1}}})
x
data vector
m
smoothing length; 0 < m <= nrow(x)/2 (default=1)
type
selects the smoothing algorithm (default=0)
soutput step size; 0 < s <= nrow(x)/2 (default=1)
Description

The smoothing function is selected by the argument type. The smoothed value xs[i] is computed from the data values x[i-m] to x[i+m].

type smoothing algorithm xs[i] =
0 (x[i-m] + .. + x[i] + .. + x[i+m]) / (2*m+1)
Result
A vector r with nrow(x)/s elements. The value r[j] is set to the value xs[j*s] of the smoothed data vector.

Navigation menu

Personal tools