A multiple regression with two independent variables

5 views (last 30 days)
Question about liner or non linear experimental data fitting with two independent and dependent variable.
I have this eq: Can you perform a multiple regression with two independent variablesa multiple regression with two independent variables but one of them constant ? for example I have this data
How I can get a good fiting for this data in two variables (theta,Length)?
Angle (Theta) Length ratio (%) Force (kn)
0 1 52.1
0.174444444 1 52.9
0.261666667 1 53.3
0.348888889 1 55.5
0.436111111 1 58.1
  10 Comments
IBRAHIM BUMADIAN
IBRAHIM BUMADIAN on 21 May 2019
The first value of L is 0.1.
The observation when the theta is increseing and L is incresing the Force increseing.
For example: at theta 0.43 and L 1.0 the F= 58.1 Kn.
Also, the mix force should be 60 kn no more that and the min force 37.4 at theta 0 and L =1.
dpb
dpb on 21 May 2019
Edited: dpb on 23 May 2019
Still doesn't make any sense, but from the best we can tell from what you've described--
L=0.1*[1+0.01].^[0:5] % initial L==0.1; 1% growth between observations
th=[0 0 .1744444444 .2616666666666 .348888888888 .43611111111];
X=[th;L].'; % design matrix in fitnlm input form by column
F=[37.4 52.1 52.9 53.3 55.5 58.1].'; % response variable
% define the functional form
f=@(b,x) sin(b(1)*x(:,1))+b(2)*x(:,2)+b(3)*x(:,1).*x(:,2).*sin(b(4)*x(:,1).*x(:,2));
% now try to fit the model
>> mdl=fitnlm([th;L].',F,f,ones(4,1))
mdl =
Nonlinear regression model:
y ~ sin(b1*x1) + b2*x2 + b3*x1*x2*sin(b4*x1*x2)
Estimated Coefficients:
Estimate SE tStat pValue
________ ______ ________ _________
b1 47.365 27.394 1.7291 0.22594
b2 481.71 43.181 11.156 0.0079398
b3 -177.03 249.3 -0.71012 0.55126
b4 -563.44 33.912 -16.615 0.003603
Number of observations: 6, Error degrees of freedom: 2
Root Mean Squared Error: 8.76
R-Squared: 0.419, Adjusted R-Squared -0.452
F-statistic vs. zero model: 52.4, p-value = 0.0188
>>
% and see what it looks like
>> [F predict(mdl,X) predict(mdl,X)-F]
ans =
37.4000 48.1714 10.7714
52.1000 48.6531 -3.4469
52.9000 48.2740 -4.6260
53.3000 51.8218 -1.4782
55.5000 55.8213 0.3213
58.1000 56.7851 -1.3149
>>
As predicted, the overall fit is significant; but the two coefficients b(1) (A) and b(3) (C) are barely significant and note R-sq <0.5 and Adjusted R-sq < 0 -- badly conditioned system. Overall the fit is marginal for applicability/ accuracy in fitting the observed data with the functional form of the desired expression.
This could be bad data for the right model or the wrong model of choice for good data or simply that the explanation is lacking and we don't understand what the data/model really are and are misusing one or both. Particularly this length variable is yet a deep mystery as to what it really is and how to code it--the above was just a wild guess based on Sulaymon's observation/hypothesis of a fractional increase.
Going ahead anyway, as noted from looking at the input data, the first point is an outlier in the model can't fit the gross difference at theta=0.
The model itself looks peculiar, but that's the form as you wrote it.
There's still quite a lot lacking in the explanation here to make any real sense of the problem.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!