How to fit a model a=bx+cy form, for series of data?

조회 수: 6 (최근 30일)
Annu Panwar
Annu Panwar 2017년 6월 23일
답변: Bernhard Suhm 2017년 12월 6일
a=[3, 4, 6, 7,8] b=[5,9,10,12,19] a=[3,4,5,6,7,9]
x and y are known how to get the value of x and y using linear fit? I can solve the equations and get the value but I want only one values for x and y. Please provide help?
  댓글 수: 1
Hendrik
Hendrik 2017년 11월 27일
the last a should be c??? If yes what about the dimensions? dim(a & b) = [1,5]; dim(a'' =?c) = [1,6];

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

답변 (1개)

Bernhard Suhm
Bernhard Suhm 2017년 12월 6일
If you interpret a=bx+cy as a linear equation with the scalars x,y as unknown (even though you said they are known), it's an overconstrained system of linear equations and there is no solution - but you probably knew that.
If you interpret your vectors to specify a set of datapoints, with a as the 'response' and b and c as the predictors, you can force MATLAB to fit a linear model with tbl = table(c',b',a','VariableNames',{'c','b','a'}); lm = fitlm(tbl,'a~b+c','Intercept','false');
Note that I transposed your row vectors into columns to build the data table ("frame").

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by