Home > vbmeg > functions > device > filter_func > vb_multiple_regression.m

vb_multiple_regression

PURPOSE ^

Multiple linear regression

SYNOPSIS ^

function w = vb_multiple_regression(x, y)

DESCRIPTION ^

 Multiple linear regression

 - Input
   x: Independent variable (dimension x sample)
   y: Dependent variable (1 x sample)

 - Output
   w: Coefficients (1 x dimension) (end of w is bias)

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function w = vb_multiple_regression(x, y)
0002 % Multiple linear regression
0003 %
0004 % - Input
0005 %   x: Independent variable (dimension x sample)
0006 %   y: Dependent variable (1 x sample)
0007 %
0008 % - Output
0009 %   w: Coefficients (1 x dimension) (end of w is bias)
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 xt = [x', ones(size(x,2),1)];
0015 xx = xt'*xt;
0016 xy = xt'*y';
0017 w = (xx\xy)';
0018

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005