Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FractionFactor"/> class.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <param name="exponent">The exponent.</param>
 /// <param name="sequence">The sequence.</param>
 /// <param name="editable">if set to <see langword="true" /> [editable].</param>
 public FractionFactor(double value, IExpression?exponent = null, INumeric?sequence = null, bool editable = false)
     : this(Operations.RoundToMixedFraction(value, 16), exponent, sequence, editable)
 {
 }
Пример #2
0
 /// <summary>
 /// Errorses this instance.
 /// </summary>
 /// <returns></returns>
 /// <acknowledgment>
 /// https://github.com/SarahFrem/AutoRegressive_model_cs/blob/master/RegressionLineaire.cs
 /// </acknowledgment>
 public double[,] Errors() => Operations.Subtract(responseVariable, Predictions());
Пример #3
0
        /// <summary>
        /// Compute the regressors coefficients from MCO
        /// beta = inv(X'*X)*X'*Y
        /// </summary>
        /// <returns>
        /// beta
        /// </returns>
        /// <acknowledgment>
        /// https://github.com/SarahFrem/AutoRegressive_model_cs/blob/master/RegressionLineaire.cs
        /// </acknowledgment>
        public double[,] RegressorsMCO()
        {
            var R    = RegressionMatrix();
            var beta = Operations.Multiply(Operations.Multiply(Operations.Inverse(Operations.Multiply(Operations.Transpose(R), R)), Operations.Transpose(R)), responseVariable);

            return(beta);
        }
Пример #4
0
 /// <summary>
 /// Predictionses this instance.
 /// </summary>
 /// <returns></returns>
 /// <acknowledgment>
 /// https://github.com/SarahFrem/AutoRegressive_model_cs/blob/master/RegressionLineaire.cs
 /// </acknowledgment>
 public double[,] Predictions() => Operations.Multiply(RegressionMatrix(), RegressorsMCO());