Github user takuti commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/92#discussion_r125200993
  
    --- Diff: core/src/main/java/hivemall/anomaly/SDAR2D.java ---
    @@ -33,129 +33,123 @@
     
     public final class SDAR2D {
     
    -    // --------------------------------
    -    // hyperparameters
    -
    -    /**
    -     * Forgetfulness parameter
    -     */
    -    private final double _r;
    +  // --------------------------------
    +  // hyperparameters
    +
    +  /**
    +   * Forgetfulness parameter
    +   */
    +  private final double _r;
    +
    +  // --------------------------------
    +  // parameters
    +
    +  private final RealMatrix[] _C;
    +  private RealVector _mu;
    +  private RealMatrix _sigma;
    +  private RealVector _muOld;
    +  private RealMatrix _sigmaOld;
    +
    +  private boolean _initialized;
    +
    +  public SDAR2D(final double r, final int k) {
    +    Preconditions.checkArgument(0.d < r && r < 1.d, "Invalid 
forgetfullness parameter r: " + r);
    +    Preconditions.checkArgument(k >= 1, "Invalid smoothing parameter k: " 
+ k);
    +    this._r = r;
    +    this._C = new RealMatrix[k + 1];
    +    this._initialized = false;
    +  }
    +
    +  /**
    +   * @param x series of input in LIFO order
    +   * @param k AR window size
    +   * @return x_hat predicted x
    +   * @link 
https://en.wikipedia.org/wiki/Matrix_multiplication#Outer_product
    +   */
    +  @Nonnull
    +  public RealVector update(@Nonnull final ArrayRealVector[] x, final int 
k) {
    +    Preconditions.checkArgument(x.length >= 1, "x.length MUST be greather 
than 1: " + x.length);
    +    Preconditions.checkArgument(k >= 0, "k MUST be greather than or equals 
to 0: ", k);
    +    Preconditions.checkArgument(k < _C.length, "k MUST be less than |C| 
but " + "k=" + k + ", |C|="
    --- End diff --
    
    @myui Oh, it's huge...I understand what you are afraid ;(


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to