Coefficient determination for polyfit

조회 수: 4 (최근 30일)
FL
FL 2018년 10월 9일
편집: FL 2018년 10월 9일
Hi Can somebody please give some tips on below:
I have a Matrix (3x3601) and I have a vector (1x3) defined as below
gamma = 1.31; %initial values
k = -3.6; %initial values
A = (gamma-1)*(k);
B = gamma;
VECTOR = [1,A,B];
DATA = VECTOR * MATRIX;
Now, I want to use a range of values for gamma and k as below
gamma = (1.1:0.001:1.40);
k = (-3.6:0.01:-2);
k = [k, zeros(1, length(gamma) - length(k))]; %to make it of the same length
I want to use the optimum value from the range of gamma and k so that it minimizes the squared error
How do I go about it?
Thanks
  댓글 수: 2
Star Strider
Star Strider 2018년 10월 9일
‘I want to use the optimum value from the range of gamma and k so that it minimizes the squared error’
The squared error between what and what?
What model are you regressing?
(Pardon me for this.) Your post makes absolutely no sense, especially since you define gamma initially as a scalar and later as a vector.
Please describe what you want to do in a bit more detail. Note that polyfit takes vector — not matrix — arguments for its one independent and one dependent variables, so it is likely not appropriate here.
FL
FL 2018년 10월 9일
편집: FL 2018년 10월 9일
Apologies for not putting it perfectly !
I have an equation, in which I have splitted the variables (as MATRIX) and the coefficient as (VECTOR).
The equation is DATA = VECTOR*MATRIX
When I solve the equation, I get a residual vector. Now, I have to look into a range of coefficients (gamma and k, which are defined as vectors now to represent the range), which will give me a minimum residual vector. Not sure how to approach this problem. Hope it now make sense.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Gamma Functions에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by