Documentation Center

  • Trials
  • Product Updates

Contents

regression

Linear regression

Syntax

[r,m,b] = regression(t,y)
[r,m,b] = regression(t,y,'one')

Description

[r,m,b] = regression(t,y) takes these arguments,

t

Target matrix or cell array data with a total of N matrix rows

y

Output matrix or cell array data of the same size

and returns these outputs,

r

Regression values for each of the N matrix rows

m

Slope of regression fit for each of the N matrix rows

b

Offset of regression fit for each of the N matrix rows

[r,m,b] = regression(t,y,'one') combines all matrix rows before regressing, returning single scalar regression, slope and offset values.

Examples

Here a feedforward network is trained and regression performed on its targets and outputs.

[x,t] = simplefit_dataset;
net = feedforwardnet(20);
net = train(net,x,t);
y = net(x);
[r,m,b] = regression(t,y)
plotregression(t,y)

See Also

|

Was this topic helpful?