Why do EXCEL and MATLAB obtain different coefficients of pure quadratic regression? Different algorithm?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I was doing pure quadratic regression for statistics in EXCEL and MATLAB respectively. Basically, there are two input variables, with one group of values each. There are eight output variables, with one group of values each. So, later you will see there are eight rows of coefficients, each row indicates coefficients for one output variable.
I found both EXCEL and MATLAB obtain similar coefficients, but slightly different. I used "Data Analysis" in EXCEL, and "stats = regstats(reg,X,'purequadratic')" in MATLAB. in MATLAB I used "disp" function to show coefficient.
1) I would like to know why are they different?
2) If import statistics of two input variables into regressed functions, I found that there is a huge difference, when using MATLAB coefficients, between predicted values and initial values. But EXCEL coefficients function matches very well with initial output values.
I don't think MATLAB will make mistakes, but who can tell me why?
Thank you so much.
Below are initial statistics, with two rows of input, and eight rows of output.
Input 0.1 0.1 0.1 0.08 0.12;
Input 75 100 125 100 100;
Oouput 1.00 1.00 1.00 1.00 1.00;
Oouput 1.04 0.98 1.34 1.05 1.11 ;
Oouput 1.19 1.07 1.54 1.09 1.86 ;
Oouput 1.28 1.13 1.94 1.55 2.52 ;
Oouput 1.47 1.41 2.67 1.47 3.64 ;
Oouput 1.63 2.39 3.37 1.55 5.01 ;
Oouput 1.64 3.14 4.26 1.86 6.65 ;
Oouput 1.97 4.20 5.28 2.31 8.57 ;
Below are coefficients from MATLAB.
0.0000 0.0000 0.0000 0.0000 1.0000 ;
0.0000 -0.0600 250.0000 -48.5000 6.0900 ;
0.0000 -0.0900 1012.5000 -183.2500 13.2900 ;
0.0000 -0.1400 2262.5000 -428.2500 27.6900 ;
0.0000 -0.1900 2862.5000 -518.2500 32.7700 ;
0.0000 0.0000 2225.0000 -358.5000 14.2700 ;
0.0000 0.1100 2787.5000 -437.7500 10.7600 ;
0.0000 0.2500 3100.0000 -463.5000 3.7300 ;
Below are coefficients from EXCEL.
0 0 0 0 1;
0.000328417 -0.059704055 243.5669198 -47.21194018 5.955417092;
0.000471708 -0.087383325 1009.858681 -182.7702993 13.267276;
0.000762784 -0.139532918 2250.695149 -425.7704731 27.5291594;
0.001047444 -0.185498787 2856.424299 -516.8874342 32.61387372;
0.000168824 0.00106616 2212.027358 -355.8364858 14.06052536;
-0.000301934 0.112609147 2784.833039 -437.1320185 10.7621216;
-0.00092363 0.251040732 3090.051207 -461.5862656 3.594040508;
2 Kommentare
dpb
am 1 Aug. 2013
What kind of model has 37(!) polynomial coefficients????
As for differences in estimated coefficients, how did you get data into each program to compare--do both start with identical data? How did you do the estimation in each?
For using the coefficients from Matlab, how did you do the evaluation and were these the coefficients in memory or did you try to export them as text as above?
Too many uncertainties to have any specific answers...
Antworten (1)
Walter Roberson
am 1 Aug. 2013
The coefficients are not as different as it might appear at first.
At the MATLAB prompt, give the command
format g
before displaying the coefficients.
2 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!