Memuat
Memuat
Linear Regression with fitlm for Geophysics and Seismology
0 views
Model earthquake magnitude as a linear function of fault length and rupture duration with fitlm and test coefficient significance. fitlm builds a linear regression model from a data table and provides coefficients, significance tests, R2, and residual diagnostics. It suits theses that test the effect of several predictors on one response.

Model earthquake magnitude as a linear function of fault length and rupture duration with fitlm and test coefficient significance.
| Role | Variable | Unit |
|---|---|---|
| Main | Earthquake magnitude | Mw |
| Supporting 1 | Fault length | km |
| Supporting 2 | Rupture duration | s |
Linear regression of Earthquake magnitude on Fault length and Rupture duration yields an R-squared of 0.951 (adjusted 0.950) and RMSE 0.601; the coefficients are Fault length=2.970 and Rupture duration=-1.598 with 95% confidence intervals excluding zero.
Computed from illustrative synthetic data, not from a real study.
fitlm builds a linear regression model from a data table and provides coefficients, significance tests, R2, and residual diagnostics. It suits theses that test the effect of several predictors on one response.
Report coefficients with standard errors, p-values, confidence intervals, adjusted R2, and the model F test. Discuss assumption violations and influential observations (Cook's distance) if any.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
rng(1);
n = 150;
fault_length = 50 + 10*randn(n, 1);
rupture_duration = 20 + 5*randn(n, 1);
earthquake_magnitude = 5 + 0.8*fault_length - 1.2*rupture_duration + 4*randn(n, 1);
tbl = table(fault_length, rupture_duration, earthquake_magnitude, 'VariableNames', {'fault_length', 'rupture_duration', 'earthquake_magnitude'});
mdl = fitlm(tbl, 'earthquake_magnitude ~ fault_length + rupture_duration');
disp(mdl);
fprintf('R2 = %.3f, adjusted R2 = %.3f, RMSE = %.3f\n', ...
mdl.Rsquared.Ordinary, mdl.Rsquared.Adjusted, mdl.RMSE);
disp(coefCI(mdl));
disp(anova(mdl, 'summary'));
[~, pSW] = lillietest(mdl.Residuals.Raw);
fprintf('Residual normality (Lilliefors) p = %.3f\n', pSW);
figure;
subplot(1,3,1); plotResiduals(mdl, 'probability');
subplot(1,3,2); plotResiduals(mdl, 'fitted');
subplot(1,3,3); plot(mdl.Fitted, tbl.earthquake_magnitude, '.'); hold on; refline(1, 0);
xlabel('Fitted'); ylabel('Actual');Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$19
excl. 11% VAT
Duration: 3 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$59
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$128
excl. 11% VAT
Duration: 12-15 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Linear Regression with fitlm is commonly used at this level in Geophysics and Seismology. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output MATLAB gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$19, Package 2 (your data analysis and interpretation) US$59 and Package 3 (full guidance) US$128, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio