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 */
017 package org.apache.commons.math.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 * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
031 * @since 2.0
032 */
033 public interface MultipleLinearRegression {
034
035 /**
036 * Estimates the regression parameters b.
037 *
038 * @return The [k,1] array representing b
039 */
040 double[] estimateRegressionParameters();
041
042 /**
043 * Estimates the variance of the regression parameters, ie Var(b).
044 *
045 * @return The [k,k] array representing the variance of b
046 */
047 double[][] estimateRegressionParametersVariance();
048
049 /**
050 * Estimates the residuals, ie u = y - X*b.
051 *
052 * @return The [n,1] array representing the residuals
053 */
054 double[] estimateResiduals();
055
056 /**
057 * Returns the variance of the regressand, ie Var(y).
058 *
059 * @return The double representing the variance of y
060 */
061 double estimateRegressandVariance();
062
063 /**
064 * Returns the standard errors of the regression parameters.
065 *
066 * @return standard errors of estimated regression parameters
067 */
068 double[] estimateRegressionParametersStandardErrors();
069
070 }