regress with vectors arguments

Hello,i know that in regress we make an estimation of our data using some other vector.
In here We have estimation of two data simultaniosly m10 and m5 as shown in the code bellow.
BINT are the intervals of B ,R are the residuals.
I have an output shown bellow.
B has only two values(one for each data vector)
so i think my estimate for m10 is b[1]*v1 and m5 is b[2]*v2
Why B size is 2X1 but R is 10 values,
I cant link visually R,Bint values to the B vector(there is a size mismatch between them).can i somehow visualize the connection between R,Bint values and my coeffient B vector values ?
Thanks.
e=0.001;
T=10;
eT=e*T;
coeff_1 = 0.05;
coeff_2 = 0.07;
n=5;
m10 = 2*eT+3*e + coeff_1*randn(n,1);
m5 = 4*eT+5*e + coeff_2*randn(n,1);
v1=repmat([2,3],n,1);
v2=repmat([4,5],n,1)];
[B,BINT,R] = regress([m10;m5],[v1;v2]);

Respuestas (1)

Star Strider
Star Strider el 5 de Mzo. de 2020

0 votos

Why B size is 2X1 but R is 10 values
As I understand your Question, it is because ‘B’ is a (coefficient) vector of parameters, and you are only fitting two colums. There will be one B parameter for each column. If you add a third ones column (to specify the intercept) there would be three ‘B’ values (and a more accurate regression).

4 comentarios

fima v
fima v el 6 de Mzo. de 2020
Why in residuals we have 10 members ? If B is only 2 members?
Star Strider
Star Strider el 6 de Mzo. de 2020
The residuals are the differencew between the fitted curve (requiring two parameters) and the data (apparently comprising 10 elements).
fima v
fima v el 6 de Mzo. de 2020
Hello, so how do i use the residuals to estimate the error of my estimation?
Thanks
Star Strider
Star Strider el 6 de Mzo. de 2020
The regress funciton will do all that for you. See Determine Significance of Linear Regression Relationship, and for confidence intervals on the regression, use fitlm and predict.
You can of course code all these yourself. I do not recommend that.

Iniciar sesión para comentar.

Preguntada:

el 5 de Mzo. de 2020

Comentada:

el 6 de Mzo. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by