Skip to content

Commit

Permalink
Improved parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 25, 2023
1 parent 40816da commit b370f12
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/mstl_params.rs
Expand Up @@ -20,8 +20,8 @@ impl MstlParams {
}

/// Sets the number of iterations.
pub fn iterations(&mut self, iterate: usize) -> &mut Self {
self.iterate = iterate;
pub fn iterations(&mut self, iterations: usize) -> &mut Self {
self.iterate = iterations;
self
}

Expand All @@ -32,8 +32,8 @@ impl MstlParams {
}

/// Sets the lengths of the seasonal smoothers.
pub fn seasonal_lengths(&mut self, swin: &[usize]) -> &mut Self {
self.swin = Some(swin.to_vec());
pub fn seasonal_lengths(&mut self, lengths: &[usize]) -> &mut Self {
self.swin = Some(lengths.to_vec());
self
}

Expand Down
44 changes: 22 additions & 22 deletions src/stl_params.rs
Expand Up @@ -37,68 +37,68 @@ impl StlParams {
}

/// Sets the length of the seasonal smoother.
pub fn seasonal_length(&mut self, ns: usize) -> &mut Self {
self.ns = Some(ns);
pub fn seasonal_length(&mut self, length: usize) -> &mut Self {
self.ns = Some(length);
self
}

/// Sets the length of the trend smoother.
pub fn trend_length(&mut self, nt: usize) -> &mut Self {
self.nt = Some(nt);
pub fn trend_length(&mut self, length: usize) -> &mut Self {
self.nt = Some(length);
self
}

/// Sets the length of the low-pass filter.
pub fn low_pass_length(&mut self, nl: usize) -> &mut Self {
self.nl = Some(nl);
pub fn low_pass_length(&mut self, length: usize) -> &mut Self {
self.nl = Some(length);
self
}

/// Sets the degree of locally-fitted polynomial in seasonal smoothing.
pub fn seasonal_degree(&mut self, isdeg: i32) -> &mut Self {
self.isdeg = isdeg;
pub fn seasonal_degree(&mut self, degree: i32) -> &mut Self {
self.isdeg = degree;
self
}

/// Sets the degree of locally-fitted polynomial in trend smoothing.
pub fn trend_degree(&mut self, itdeg: i32) -> &mut Self {
self.itdeg = itdeg;
pub fn trend_degree(&mut self, degree: i32) -> &mut Self {
self.itdeg = degree;
self
}

/// Sets the degree of locally-fitted polynomial in low-pass smoothing.
pub fn low_pass_degree(&mut self, ildeg: i32) -> &mut Self {
self.ildeg = Some(ildeg);
pub fn low_pass_degree(&mut self, degree: i32) -> &mut Self {
self.ildeg = Some(degree);
self
}

/// Sets the skipping value for seasonal smoothing.
pub fn seasonal_jump(&mut self, nsjump: usize) -> &mut Self {
self.nsjump = Some(nsjump);
pub fn seasonal_jump(&mut self, jump: usize) -> &mut Self {
self.nsjump = Some(jump);
self
}

/// Sets the skipping value for trend smoothing.
pub fn trend_jump(&mut self, ntjump: usize) -> &mut Self {
self.ntjump = Some(ntjump);
pub fn trend_jump(&mut self, jump: usize) -> &mut Self {
self.ntjump = Some(jump);
self
}

/// Sets the skipping value for low-pass smoothing.
pub fn low_pass_jump(&mut self, nljump: usize) -> &mut Self {
self.nljump = Some(nljump);
pub fn low_pass_jump(&mut self, jump: usize) -> &mut Self {
self.nljump = Some(jump);
self
}

/// Sets the number of loops for updating the seasonal and trend components.
pub fn inner_loops(&mut self, ni: usize) -> &mut Self {
self.ni = Some(ni);
pub fn inner_loops(&mut self, loops: usize) -> &mut Self {
self.ni = Some(loops);
self
}

/// Sets the number of iterations of robust fitting.
pub fn outer_loops(&mut self, no: usize) -> &mut Self {
self.no = Some(no);
pub fn outer_loops(&mut self, loops: usize) -> &mut Self {
self.no = Some(loops);
self
}

Expand Down

0 comments on commit b370f12

Please sign in to comment.