001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.math4.legacy.stat.regression;
018
019/**
020 * The multiple linear regression can be represented in matrix-notation.
021 * <pre>
022 *  y=X*b+u
023 * </pre>
024 * where y is an <code>n-vector</code> <b>regressand</b>, X is a <code>[n,k]</code> matrix whose <code>k</code> columns are called
025 * <b>regressors</b>, b is <code>k-vector</code> of <b>regression parameters</b> and <code>u</code> is an <code>n-vector</code>
026 * of <b>error terms</b> or <b>residuals</b>.
027 *
028 * The notation is quite standard in literature,
029 * cf eg <a href="http://www.econ.queensu.ca/ETM">Davidson and MacKinnon, Econometrics Theory and Methods, 2004</a>.
030 * @since 2.0
031 */
032public interface MultipleLinearRegression {
033
034    /**
035     * Estimates the regression parameters b.
036     *
037     * @return The [k,1] array representing b
038     */
039    double[] estimateRegressionParameters();
040
041    /**
042     * Estimates the variance of the regression parameters, ie Var(b).
043     *
044     * @return The [k,k] array representing the variance of b
045     */
046    double[][] estimateRegressionParametersVariance();
047
048    /**
049     * Estimates the residuals, ie u = y - X*b.
050     *
051     * @return The [n,1] array representing the residuals
052     */
053    double[] estimateResiduals();
054
055    /**
056     * Returns the variance of the regressand, ie Var(y).
057     *
058     * @return The double representing the variance of y
059     */
060    double estimateRegressandVariance();
061
062    /**
063     * Returns the standard errors of the regression parameters.
064     *
065     * @return standard errors of estimated regression parameters
066     */
067     double[] estimateRegressionParametersStandardErrors();
068}