/// <summary>Initializes a new instance of the <see cref="State"/> class.
            /// </summary>
            /// <param name="rank">The rank of the decomposed correlation matrix, i.e. of matrix B where B * B^t represents the correlation matrix.</param>
            /// <param name="iterationsNeeded">The number of iterations needed by the algorithm to reach the desired accuracy.</param>
            /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
            protected internal State(int rank, int iterationsNeeded = Int32.MaxValue, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Low)
            {
                IterationsNeeded = iterationsNeeded;
                Rank = rank;
                InfoOutputDetailLevel = infoOutputDetailLevel;

                var strBuilder = new StringBuilder();
                strBuilder.AppendFormat("Rank: {0}", Rank);

                if (iterationsNeeded < Int32.MaxValue)
                {
                    strBuilder.AppendFormat("; Iterations needed: {0}", iterationsNeeded);
                }
                m_StringRepresentation = strBuilder.ToString();

                m_FillInfoOutput = (infoOutput, categoryName) =>
                {
                    var infoOutputPackage = infoOutput.AcquirePackage(categoryName);
                    infoOutputPackage.Add("Rank", Rank);

                    if (iterationsNeeded < Int32.MaxValue)
                    {
                        infoOutputPackage.Add("Iterations needed", IterationsNeeded);
                    }
                };
            }
Пример #2
0
        /// <summary>Gets informations of the current object as a specific <see cref="InfoOutput" /> instance.
        /// </summary>
        /// <param name="infoOutput">The <see cref="InfoOutput" /> object which is to be filled with informations concering the current instance.</param>
        /// <param name="categoryName">The name of the category, i.e. all informations will be added to these category.</param>
        public void FillInfoOutput(InfoOutput infoOutput, string categoryName = InfoOutput.GeneralCategoryName)
        {
            var infoOutputPackage = infoOutput.AcquirePackage(categoryName);

            infoOutputPackage.Add("Distribution", "Empirical");
            infoOutputPackage.Add("Sample Size", SampleSize);
            infoOutputPackage.Add("Mean", Mean);

            infoOutputPackage.Add("Minimum", Minimum);
            infoOutputPackage.Add("Maximum", Maximum);
            infoOutputPackage.Add("Media", Median);

            if (InfoOutputDetailLevel.IsAtLeastAsComprehensiveAs(InfoOutputDetailLevel.High) == true)
            {
                var sampleDataTable = new DataTable("Sample");
                sampleDataTable.Columns.Add("Value", typeof(double));
                foreach (var value in Sample)
                {
                    var row = sampleDataTable.NewRow();
                    row[0] = value;
                    sampleDataTable.Rows.Add(row);
                }
                infoOutputPackage.Add(sampleDataTable);
            }
            m_MomentCalculator.Value.FillInfoOutput(infoOutput, categoryName + ".Moments");
            m_DensityEstimator.FillInfoOutput(infoOutput, categoryName + ".Density");
        }
Пример #3
0
        /// <summary>Creates a 'n x r' matrix B such that B * B' is a correlation matrix and 'near' to the specified symmetric, normalized matrix of dimension n. A rank reduction will apply if r is strict less than n.
        /// </summary>
        /// <param name="rawCorrelationMatrix">The symmetric, normalized matrix where to find the 'nearest' correlation matrix.</param>
        /// <param name="state">The state of the operation in its <see cref="PseudoSqrtMatrixDecomposer.State"/> representation (output).</param>
        /// <param name="triangularMatrixType">A value indicating which part of <paramref name="rawCorrelationMatrix"/> to take into account.</param>
        /// <param name="outputEntries">This argument will be used to store the matrix entries of the resulting matrix B, i.e. the return value array points to this array if != <c>null</c>; otherwise a memory allocation will be done.</param>
        /// <param name="worksspaceContainer">A specific <see cref="PseudoSqrtMatrixDecomposer.WorkspaceContainer"/> object to reduce memory allocation; ignored if <c>null</c>.</param>
        /// <returns>A <see cref="DenseMatrix"/> object that represents a matrix B such that B * B' is the 'nearest' correlation matrix with respect to <paramref name="rawCorrelationMatrix"/>.</returns>
        /// <remarks>In general the return object does <b>not</b> represents the pseudo-root of <paramref name="rawCorrelationMatrix"/>, i.e. output of the Cholesky decomposition.
        /// <para>The parameters <paramref name="outputEntries"/>, <paramref name="worksspaceContainer"/> allows to avoid memory allocation and to re-use arrays if the calculation of correlation matrices will be done often.</para></remarks>
        public override DenseMatrix Create(DenseMatrix rawCorrelationMatrix, out State state, double[] outputEntries = null, PseudoSqrtMatrixDecomposer.WorkspaceContainer worksspaceContainer = null, BLAS.TriangularMatrixType triangularMatrixType = BLAS.TriangularMatrixType.LowerTriangularMatrix)
        {
            if (rawCorrelationMatrix.IsQuadratic == false)
            {
                throw new ArgumentException("rawCorrelationMatrix");
            }
            int n = rawCorrelationMatrix.RowCount;

            if ((outputEntries == null) || (outputEntries.Length < n * n))
            {
                outputEntries = new double[n * n];
            }
            var ws = worksspaceContainer as Workspace;

            if ((ws == null) || (ws.Dimension < n))
            {
                ws = new Workspace(n);
            }

            int m;

            BLAS.Level1.dcopy(n * n, rawCorrelationMatrix.Data, ws.data);
            LAPACK.EigenValues.Symmetric.driver_dsyevr(LapackEigenvalues.SymmetricGeneralJob.All, n, ws.data, out m, ws.eigenValues, outputEntries, ws.isuppz, ws.work, ws.iwork);
            var originalEigenValueDataTable = InfoOutputDetailLevel.IsAtLeastAsComprehensiveAs(InfoOutputDetailLevel.High) ? CreateDataTableWithEigenvalues("Eigenvalues.Original", m, ws.eigenValues) : null;

            int rank = n;
            int minNumberOfEigenvaluesToSetZero = n - Math.Min(MaximalRank ?? n, n);
            int i = 0;

            while ((i < minNumberOfEigenvaluesToSetZero) || (ws.eigenValues[i] < 0.0))
            {
                ws.eigenValues[i] = 0.0;
                i++;
                rank--;
            }
            var adjustedEigenValueDataTable = InfoOutputDetailLevel.IsAtLeastAsComprehensiveAs(InfoOutputDetailLevel.High) ? CreateDataTableWithEigenvalues("Eigenvalues.Adjusted", m, ws.eigenValues) : null;

            VectorUnit.Basics.Sqrt(n, ws.eigenValues); // calculate sqrt of eigenvalues only once, i.e. the array 'eigenValues' contains the sqrt of the eigenvalues!
            for (i = 0; i < n; i++)
            {
                var t_i = 0.0;
                for (int j = n - 1; j >= n - rank; j--)
                {
                    t_i += outputEntries[i + j * n] * outputEntries[i + j * n] * ws.eigenValues[j] * ws.eigenValues[j];
                    outputEntries[i + j * n] *= ws.eigenValues[j];
                }
                BLAS.Level1.dscal(rank, 1.0 / Math.Sqrt(t_i), outputEntries, -n, i + (n - 1) * n); // [i+j*n] *= 1/Math.Sqrt(tempValue) for j = n-1, ..., n-rank
            }

            /* The eigenvalues are in ascending order. Thefore the first (and not last) 'rank' columns of the eigenvectors are not required. Therefore we swap the relevant part  */
            BLAS.Level1.dscal(n * (n - rank), 0.0, outputEntries);
            BLAS.Level1.dswap(n * rank, outputEntries, 1, outputEntries, 1, n * (n - rank), 0);

            state = State.Create(rank, detailProperties: new[] { InfoOutputProperty.Create("Eigenvalues set to 0.0", n - rank) }, detailDataTables: new[] { originalEigenValueDataTable, adjustedEigenValueDataTable }, iterationsNeeded: 1, infoOutputDetailLevel: InfoOutputDetailLevel);
            return(new DenseMatrix(n, rank, outputEntries));
        }
Пример #4
0
 /// <summary>Initializes a new instance of the <see cref="State"/> class.
 /// </summary>
 /// <param name="classification">The classification of the result.</param>
 /// <param name="infoOutputPackageAction">A method applied to fill a specific <see cref="InfoOutputPackage"/>.</param>
 /// <param name="infoOutputDetailLevel">The info output detail level.</param>
 protected internal State(NumericalIntegratorErrorClassification classification, Action <InfoOutputPackage> infoOutputPackageAction, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Full)
 {
     Classification        = classification;
     InfoOutputDetailLevel = infoOutputDetailLevel;
     if (infoOutputPackageAction == null)
     {
         throw new ArgumentNullException(nameof(infoOutputPackageAction));
     }
     m_InfoOutputPackageAction = infoOutputPackageAction;
 }
Пример #5
0
        /// <summary>Creates a 'n x r' matrix B such that B * B' is a correlation matrix and 'near' to the specified symmetric, normalized matrix of dimension n. A rank reduction will apply if r is strict less than n.
        /// </summary>
        /// <param name="rawCorrelationMatrix">The symmetric, normalized matrix where to find the 'nearest' correlation matrix.</param>
        /// <param name="state">The state of the operation in its <see cref="PseudoSqrtMatrixDecomposer.State"/> representation (output).</param>
        /// <param name="triangularMatrixType">A value indicating which part of <paramref name="rawCorrelationMatrix"/> to take into account.</param>
        /// <param name="outputEntries">This argument will be used to store the matrix entries of the resulting matrix B, i.e. the return value array points to this array if != <c>null</c>; otherwise a memory allocation will be done.</param>
        /// <param name="worksspaceContainer">A specific <see cref="PseudoSqrtMatrixDecomposer.WorkspaceContainer"/> object to reduce memory allocation; ignored if <c>null</c>.</param>
        /// <returns>A <see cref="DenseMatrix"/> object that represents a matrix B such that B * B' is the 'nearest' correlation matrix with respect to <paramref name="rawCorrelationMatrix"/>.</returns>
        /// <remarks>In general the return object does <b>not</b> represents the pseudo-root of <paramref name="rawCorrelationMatrix"/>, i.e. output of the Cholesky decomposition.
        /// <para>The parameters <paramref name="outputEntries"/>, <paramref name="worksspaceContainer"/> allows to avoid memory allocation and to re-use arrays if the calculation of correlation matrices will be done often.</para></remarks>
        public override DenseMatrix Create(DenseMatrix rawCorrelationMatrix, out State state, double[] outputEntries = null, PseudoSqrtMatrixDecomposer.WorkspaceContainer worksspaceContainer = null, BLAS.TriangularMatrixType triangularMatrixType = BLAS.TriangularMatrixType.LowerTriangularMatrix)
        {
            if (rawCorrelationMatrix.IsQuadratic == false)
            {
                throw new ArgumentException("rawCorrelationMatrix");
            }
            int n = rawCorrelationMatrix.RowCount;

            var ws = worksspaceContainer as Workspace;

            if ((ws == null) || (ws.Dimension < n))
            {
                ws = new Workspace(n, this);
            }

            /* calculate an initial value for the optimizer:
             *   (i) Apply the EZN algorithm for the calculation of a matrix B_0 such that B_0 * B_0^t is near to the (raw) correlation matrix
             *   (ii) calculate angle parameters \theta such that B_0 = B(\theta).
             *  */
            State initState;
            var   initialAngleParameterMatrix = GetAngleParameter(m_InitialDecomposer.Create(rawCorrelationMatrix, out initState, outputEntries, ws.InitalDecomposerWorkspace, triangularMatrixType), ws.ArgMinData);

            /* prepare and apply optimization algorithm: */
            int rank = initState.Rank;

            if ((outputEntries == null) || (outputEntries.Length < n * n))
            {
                outputEntries = new double[n * rank];
            }

            var B            = new DenseMatrix(n, rank, outputEntries, createDeepCopyOfArgument: false);
            var C            = new DenseMatrix(n, n, ws.CorrelationMatrixData, createDeepCopyOfArgument: false);
            var optAlgorithm = m_MultiDimOptimizer.Create(n * (rank - 1));

            optAlgorithm.SetFunction(theta =>
            {
                GetParametricMatrix(theta, B);
                C.AddAssignment(B, B.T, beta: 0.0); // C = B * B^t

                VectorUnit.Basics.Sub(n * n, C.Data, rawCorrelationMatrix.Data, ws.TempDifferences);
                return(BLAS.Level1.dnrm2sq(n * n, ws.TempDifferences));
            });
            double minimum;
            var    optState = optAlgorithm.FindMinimum(ws.ArgMinData, out minimum);

            state = State.Create(rank, optState.IterationsNeeded, InfoOutputDetailLevel,
                                 Tuple.Create <string, IInfoOutputQueriable>("Initial.State", initState),
                                 Tuple.Create <string, IInfoOutputQueriable>("Final.Optimizer", optState),
                                 Tuple.Create <string, IInfoOutputQueriable>("Initial.Parameters", initialAngleParameterMatrix),
                                 InfoOutputDetailLevel.IsAtLeastAsComprehensiveAs(InfoOutputDetailLevel.High) ? Tuple.Create <string, IInfoOutputQueriable>("Final.Parameters", new DenseMatrix(n, rank, ws.ArgMinData, createDeepCopyOfArgument: false)) : null
                                 );

            GetParametricMatrix(ws.ArgMinData, B); // B should be already set to B(\theta^*), we just want to be sure that B is correct on exit
            return(B);
        }
Пример #6
0
        /// <summary>Gets the level of details, i.e. the value of the optional property 'Level of Details'.
        /// </summary>
        /// <param name="generalPropertyExcelDataQuery">A <see cref="IExcelDataQuery"/> object that contains general properties.</param>
        /// <param name="propertyValueColumnIndex">The null-based index of the column which contains the value, the second column is standard.</param>
        /// <returns>A value indicating the level of detail for the output, i.e. for the Pool inspector etc.</returns>
        public static InfoOutputDetailLevel GetLevelOfDetails(this IExcelDataQuery generalPropertyExcelDataQuery, int propertyValueColumnIndex = 1)
        {
            if (generalPropertyExcelDataQuery == null)
            {
                throw new ArgumentNullException("generalPropertyExcelDataQuery");
            }
            InfoOutputDetailLevel levelOfDetails = InfoOutputDetailLevel.Full;

            generalPropertyExcelDataQuery.TryGetOptionalPropertyValue <InfoOutputDetailLevel>("Level of Details", ref levelOfDetails, EnumStringRepresentationUsage.StringAttribute, propertyValueColumnIndex);
            return(levelOfDetails);
        }
Пример #7
0
 /// <summary>Initializes a new instance of the <see cref="SapMatrixDecomposer" /> class.
 /// </summary>
 /// <param name="multiDimOptmizer">The multi-dimensional </param>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 public SapMatrixDecomposer(OrdinaryMultiDimOptimizer multiDimOptmizer, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
     : base(infoOutputDetailLevel)
 {
     if (multiDimOptmizer == null)
     {
         throw new ArgumentNullException("multiDimOptmizer");
     }
     m_MultiDimOptimizer = multiDimOptmizer;
     m_InitialDecomposer = new EznMatrixDecomposer();
     m_Name = new IdentifierString("SAP Decomposer");
 }
            /// <summary>Initializes a new instance of the <see cref="State"/> class.
            /// </summary>
            /// <param name="rank">The rank of the decomposed correlation matrix, i.e. of matrix B where B * B^t represents the correlation matrix.</param>
            /// <param name="detailProperties">Additional details in its <see cref="InfoOutputProperty"/> representation.</param>
            /// <param name="detailDataTables">Additional details in its <see cref="DataTable"/> representation; <c>null</c> entries will be ignored.</param>
            /// <param name="iterationsNeeded">The number of iterations needed by the algorithm to reach the desired accuracy.</param>
            /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
            protected internal State(int rank, IList<InfoOutputProperty> detailProperties, IList<DataTable> detailDataTables, int iterationsNeeded, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.High)
            {
                IterationsNeeded = iterationsNeeded;
                Rank = rank;
                InfoOutputDetailLevel = infoOutputDetailLevel;

                var strBuilder = new StringBuilder();
                strBuilder.AppendFormat("Rank: {0}", Rank);

                if (iterationsNeeded < Int32.MaxValue)
                {
                    strBuilder.AppendFormat("; Iterations needed: {0}", iterationsNeeded);
                }

                if (detailProperties != null)
                {
                    foreach (var property in detailProperties)
                    {
                        strBuilder.AppendFormat("; {0}: {1}", property.Name.String, property.Value);
                    }
                }
                m_StringRepresentation = strBuilder.ToString();

                m_FillInfoOutput = (infoOutput, categoryName) =>
                {
                    var infoOutputPackage = infoOutput.AcquirePackage(categoryName);
                    infoOutputPackage.Add("Rank", Rank);

                    if (iterationsNeeded < Int32.MaxValue)
                    {
                        infoOutputPackage.Add("Iterations needed", IterationsNeeded);
                    }
                    if (detailProperties != null)
                    {
                        foreach (var property in detailProperties)
                        {
                            infoOutputPackage.Add(property);
                        }
                    }
                    if (detailDataTables != null)
                    {
                        foreach (var dataTable in detailDataTables)
                        {
                            if (dataTable != null)
                            {
                                infoOutputPackage.Add(dataTable);
                            }
                        }
                    }
                };
            }
            /// <summary>Initializes a new instance of the <see cref="State"/> class.
            /// </summary>
            /// <param name="rank">The rank of the decomposed correlation matrix, i.e. of matrix B where B * B^t represents the correlation matrix.</param>
            /// <param name="details">Additional details in its <see cref="IInfoOutputQueriable"/> representation together with a specific name.</param>
            /// <param name="iterationsNeeded">The number of iterations needed by the algorithm to reach the desired accuracy.</param>
            /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
            protected internal State(int rank, IEnumerable<Tuple<string, IInfoOutputQueriable>> details, int iterationsNeeded = Int32.MaxValue, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.High)
            {
                IterationsNeeded = iterationsNeeded;
                Rank = rank;
                InfoOutputDetailLevel = infoOutputDetailLevel;

                var strBuilder = new StringBuilder();
                strBuilder.AppendFormat("Rank: {0}", Rank);

                if (iterationsNeeded < Int32.MaxValue)
                {
                    strBuilder.AppendFormat("; Iterations needed: {0}", iterationsNeeded);
                }

                if (details != null)
                {
                    foreach (var item in details)
                    {
                        if (item != null)
                        {
                            strBuilder.AppendFormat("; <{0}: {1}>", item.Item1, item.Item2.ToString());
                        }
                    }
                }
                m_StringRepresentation = strBuilder.ToString();

                m_FillInfoOutput = (infoOutput, categoryName) =>
                {
                    var infoOutputPackage = infoOutput.AcquirePackage(categoryName);
                    infoOutputPackage.Add("Rank", Rank);

                    if (iterationsNeeded < Int32.MaxValue)
                    {
                        infoOutputPackage.Add("Iterations needed", IterationsNeeded);
                    }
                    if (details != null)
                    {
                        foreach (var item in details)
                        {
                            if (item != null)
                            {
                                item.Item2.FillInfoOutput(infoOutput, item.Item1);
                            }
                        }
                    }
                };
            }
Пример #10
0
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel" /> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel" /> has been set to <paramref name="infoOutputDetailLevel" />.</returns>
 public bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     InfoOutputDetailLevel = infoOutputDetailLevel;
     return(true);
 }
 /// <summary>Initializes a new instance of the <see cref="PseudoSqrtMatrixDecomposer"/> class.
 /// </summary>
 /// <param name="annotation">The annotation, i.e. short description, of the correlation matrix decomposer.</param>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 protected PseudoSqrtMatrixDecomposer(string annotation, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
 {
     Annotation            = (annotation != null) ? annotation : String.Empty;
     InfoOutputDetailLevel = infoOutputDetailLevel;
 }
 /// <summary>Initializes a new instance of the <see cref="PseudoSqrtMatrixDecomposer"/> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 protected PseudoSqrtMatrixDecomposer(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
 {
     Annotation            = String.Empty;
     InfoOutputDetailLevel = infoOutputDetailLevel;
 }
Пример #13
0
 /// <summary>Initializes a new instance of the <see cref="QuadraticProgram"/> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail in its <see cref="Dodoni.BasicComponents.Containers.InfoOutputDetailLevel"/> representation.</param>
 protected QuadraticProgram(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Full)
     : base(infoOutputDetailLevel)
 {
 }
 /// <summary>Creates a new <see cref="State"/> object.
 /// </summary>
 /// <param name="rank">The rank of the decomposed correlation matrix, i.e. of matrix B where B * B^t represents the correlation matrix.</param>
 /// <param name="iterationsNeeded">The number of iterations needed by the algorithm to reach the desired accuracy.</param>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <param name="details">Additional details in its <see cref="IInfoOutputQueriable"/> representation together with a specific name.</param>
 /// <returns>A <see cref="State"/> object that represents the state of a specific calculation.</returns>
 public static State Create(int rank, int iterationsNeeded = Int32.MaxValue, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.High, params Tuple<string, IInfoOutputQueriable>[] details)
 {
     return new State(rank, details, iterationsNeeded, infoOutputDetailLevel);
 }
Пример #15
0
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> has been set to <paramref name="infoOutputDetailLevel"/>.</returns>
 bool IInfoOutputQueriable.TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(infoOutputDetailLevel == InfoOutputDetailLevel.Full);
 }
Пример #16
0
 /// <summary>Initializes a new instance of the <see cref="EznMatrixDecomposer" /> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 public EznMatrixDecomposer(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
     : base(infoOutputDetailLevel)
 {
     MaximalRank = null;
     m_Name      = new IdentifierString("EZN Decomposer");
 }
Пример #17
0
 /// <summary>Initializes a new instance of the <see cref="DensityEstimator" /> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info output detail level.</param>
 /// <param name="annotation">The annotation of the current instance.</param>
 protected DensityEstimator(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.High, string annotation = "")
 {
     Annotation            = annotation;
     InfoOutputDetailLevel = infoOutputDetailLevel;
 }
Пример #18
0
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel" /> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 protected void SetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     InfoOutputDetailLevel = infoOutputDetailLevel;
 }
 /// <summary>Initializes a new instance of the <see cref="MLEstimator" /> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">A value indicating the level of detail.</param>
 internal MLEstimator(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     InfoOutputDetailLevel = infoOutputDetailLevel;
     Name     = new IdentifierString("ML Estimator");
     LongName = new IdentifierString("Log-Normal distribution: ML Estimator");
 }
            /// <summary>Creates a specific parameter estimating approach with respect to the Log-Normal distribution.
            /// </summary>
            /// <param name="method">A value indicating the method how to estimate the parameters.</param>
            /// <param name="infoOutputDetailLevel">A value indicating the level of detail.</param>
            /// <returns>The specified parameter estimating approach with respect to the Normal distribution.</returns>
            public static IProbabilityDistributionEstimator <LogNormalDistribution> Create(Method method, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
            {
                switch (method)
                {
                case Method.MaximumLikelihood:
                    return(new MLEstimator(infoOutputDetailLevel));

                case Method.MethodsOfMoments:
                    return(new MoMEstimator(infoOutputDetailLevel));

                default:
                    throw new NotImplementedException();
                }
            }
Пример #21
0
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> has been set to <paramref name="infoOutputDetailLevel"/>.
 /// </returns>
 public bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(m_DateScheduleRule.TrySetInfoOutputDetailLevel(infoOutputDetailLevel));
 }
Пример #22
0
            /// <summary>Creates a specific parameter estimating approach with respect to the Exponential distribution.
            /// </summary>
            /// <param name="method">A value indicating the method how to estimate the parameters.</param>
            /// <param name="infoOutputDetailLevel">A value indicating the level of detail.</param>
            /// <returns>The specified parameter estimating approach with respect to the Exponential distribution.</returns>
            public static IProbabilityDistributionEstimator <ExponentialDistribution> Create(Method method = Method.Standard, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
            {
                switch (method)
                {
                case Method.Standard:
                    return(new StandardEstimator(infoOutputDetailLevel));

                default:
                    throw new NotImplementedException();
                }
            }
Пример #23
0
 /// <summary>Initializes a new instance of the <see cref="EznMatrixDecomposer" /> class.
 /// </summary>
 /// <param name="maximalRank">The maximal rank of the resulting matrix.</param>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 public EznMatrixDecomposer(int maximalRank, InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Middle)
     : base(infoOutputDetailLevel)
 {
     MaximalRank = maximalRank;
     m_Name      = new IdentifierString(String.Format("EZN Decomposer; max. rank: {0}", maximalRank));
 }
Пример #24
0
 /// <summary>Sets the <see cref="P:Dodoni.BasicComponents.Containers.IInfoOutputQueriable.InfoOutputDetailLevel"/> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="P:Dodoni.BasicComponents.Containers.IInfoOutputQueriable.InfoOutputDetailLevel"/> has been set to <paramref name="infoOutputDetailLevel"/>.</returns>
 public virtual bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(infoOutputDetailLevel == InfoOutputDetailLevel);
 }
Пример #25
0
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel" /> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel" /> has been set to <paramref name="infoOutputDetailLevel" />.</returns>
 public bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(infoOutputDetailLevel == this.InfoOutputDetailLevel);
 }
Пример #26
0
 /// <summary>Initializes a new instance of the <see cref="OneDimOptimizer"/> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail in its <see cref="Dodoni.BasicComponents.Containers.InfoOutputDetailLevel"/> representation.</param>
 protected OneDimOptimizer(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Full)
 {
     InfoOutputDetailLevel = infoOutputDetailLevel;
 }
Пример #27
0
 /// <summary>Initializes a new instance of the <see cref="StandardEstimator" /> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">A value indicating the level of detail.</param>
 internal StandardEstimator(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     InfoOutputDetailLevel = infoOutputDetailLevel;
     Name     = new IdentifierString("Standard Estimator");
     LongName = new IdentifierString("Exponential distribution: Standard Estimator");
 }
 /// <summary>Sets the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="IInfoOutputQueriable.InfoOutputDetailLevel"/> has been set to <paramref name="infoOutputDetailLevel"/>.</returns>
 public bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(m_OrdinaryFunctionDescriptor.TrySetInfoOutputDetailLevel(infoOutputDetailLevel));
 }
Пример #29
0
 /// <summary>Sets the <see cref="P:Dodoni.BasicComponents.Containers.IInfoOutputQueriable.InfoOutputDetailLevel"/> property.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail.</param>
 /// <returns>A value indicating whether the <see cref="P:Dodoni.BasicComponents.Containers.IInfoOutputQueriable.InfoOutputDetailLevel"/> has been set to <paramref name="infoOutputDetailLevel"/>.</returns>
 public bool TrySetInfoOutputDetailLevel(InfoOutputDetailLevel infoOutputDetailLevel)
 {
     return(infoOutputDetailLevel == InfoOutputDetailLevel.Full);
 }
 /// <summary>Initializes a new instance of the <see cref="OrdinaryMultiDimOptimizer"/> class.
 /// </summary>
 /// <param name="infoOutputDetailLevel">The info-output level of detail in its <see cref="Dodoni.BasicComponents.Containers.InfoOutputDetailLevel"/> representation.</param>
 protected OrdinaryMultiDimOptimizer(InfoOutputDetailLevel infoOutputDetailLevel = InfoOutputDetailLevel.Full)
     : base(infoOutputDetailLevel)
 {
 }