Skip to content

Commit

Permalink
README adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosdanieldasilva committed Feb 10, 2025
1 parent 512a759 commit 827a8c7
Showing 1 changed file with 39 additions and 23 deletions.
62 changes: 39 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,27 @@ data = DataFrame(
)

# Perform regression analysis between height and diameter
models = regression(:h, :d, data);
fitted_hipso = regression(:h, :d, data);

# Select the best model based on predefined criteria
top_model = criteria_selection(models)
# You can evaluate and rank them based on specific criteria using the criteria_table function.
criteria_table(fitted_hipso)
10×9 DataFrame
Row │ model rank adjr2 d syx aic bic normality significance
│ LinearMo Int64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1log_minus(h - 1.3) = 4.1496 - 37 7 0.935832 0.985189 4.33559 21.3377 21.9429 1.0 1.0
2log(h) = 4.0815 - 33.72 * d ^ -1 12 0.935775 0.985139 4.3375 21.3465 21.9517 1.0 1.0
31 / (h - 1.3) = 0.1685 + 61.34 17 0.935726 0.985125 4.33915 21.3541 21.9593 1.0 1.0
4log1p(h) = 4.0449 - 31.24 * d ^ 22 0.935663 0.985092 4.34128 21.3639 21.9691 1.0 1.0
5 │ h = -6.5776 + 0.8787 * d 27 0.935641 0.985057 4.34202 21.3674 21.9725 1.0 1.0
6 │ h = -17.3383 + 3.157 * log(d) ^ 2 32 0.935498 0.985022 4.34685 21.3896 21.9948 1.0 1.0
71 / h = 0.1721 + 51.94 * d ^ -2 37 0.935405 0.984988 4.34999 21.404 22.0092 1.0 1.0
8 │ h = -47.6116 + 19.56 * log(d) 44 0.934714 0.984833 4.37318 21.5104 22.1155 1.0 1.0
9log1p(h) = -1.7544 + 1.414 * log 46 0.934611 0.984971 4.37663 21.5261 22.1313 1.0 1.0
10log(h) = -2.1777 + 1.526 * log(d) 51 0.934183 0.984899 4.39093 21.5914 22.1966 1.0 1.0

# Os simply select the best model based on predefined criteria
top_model = criteria_selection(fitted_hipso)
log_minus(h - 1.3) = 4.1496 - 37.62 * d ^ -1
```

Expand All @@ -96,25 +113,25 @@ volume = DataFrame(
d = [16.9, 17.2, 17.5, 17.8, 17.8, 17.8, 17.8, 18.5, 18.5, 18.8, 19.1, 19.7, 19.7, 19.7, 20.1, 20.1, 21.0, 21.0, 21.3, 22.0, 22.0, 22.3, 22.6, 22.6, 23.6, 23.6, 23.6, 23.6, 24.2, 24.5, 24.5, 24.5, 25.1, 25.5, 25.5, 26.1, 26.4, 27.1, 27.1, 27.4, 27.4, 27.7, 28.0, 28.0, 28.3, 28.6, 29.3, 29.6, 29.9, 30.2, 30.2, 31.2, 31.2, 31.5, 31.5, 31.5, 32.1, 32.1, 32.5, 33.1, 33.4, 33.7, 33.7, 34.1, 34.4, 35.0, 35.0, 35.0, 35.0, 35.7, 36.3, 36.3, 36.6, 37.2, 37.2, 37.9, 37.9, 38.2, 38.2, 38.8, 38.8, 39.5, 39.8, 39.8, 40.1, 40.1, 40.1, 41.1, 41.4, 41.7, 41.7],
)

# Build a regression model for volume
model_volume = regression(:v, :h, :d, volume);
# Build a fitted regression models for volume
fitted_volume = regression(:v, :h, :d, volume);

# You can evaluate and rank them based on specific criteria using the criteria_table function.
ct = criteria_table(models)
criteria_table(fitted_volume)
10×9 DataFrame
Row │ model rank adjr2 d syx aic bic normality significance
│ LinearMo Int64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1log_minus(h - 1.3) = 4.1496 - 37 7 0.935832 0.985189 4.33559 21.3377 21.9429 1.0 1.0
2log(h) = 4.0815 - 33.72 * d ^ -1 12 0.935775 0.985139 4.3375 21.3465 21.9517 1.0 1.0
31 / (h - 1.3) = 0.1685 + 61.34 17 0.935726 0.985125 4.33915 21.3541 21.9593 1.0 1.0
4log1p(h) = 4.0449 - 31.24 * d ^ 22 0.935663 0.985092 4.34128 21.3639 21.9691 1.0 1.0
5h = -6.5776 + 0.8787 * d 27 0.935641 0.985057 4.34202 21.3674 21.9725 1.0 1.0
6h = -17.3383 + 3.157 * log(d) ^ 2 32 0.935498 0.985022 4.34685 21.3896 21.9948 1.0 1.0
71 / h = 0.1721 + 51.94 * d ^ -2 37 0.935405 0.984988 4.34999 21.404 22.0092 1.0 1.0
8h = -47.6116 + 19.56 * log(d) 44 0.934714 0.984833 4.37318 21.5104 22.1155 1.0 1.0
9log1p(h) = -1.7544 + 1.414 * log 46 0.934611 0.984971 4.37663 21.5261 22.1313 1.0 1.0
10log(h) = -2.1777 + 1.526 * log(d) 51 0.934183 0.984899 4.39093 21.5914 22.1966 1.0 1.0
Row │ model rank adjr2 d syx aic bic normality significance
│ LinearMo Int64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1log(v) = -10.2033 + 0.005545 * h 7 0.973721 0.99354 9.13789 -219.724 -209.68 1.0 1.0
2log(v) = -10.4441 + 0.005997 * h 12 0.973696 0.993532 9.14211 -219.64 -209.596 1.0 1.0
3log(v) = -6.5575 + 0.495 * d + 0 18 0.9736 0.993491 9.1589 -219.306 -209.262 1.0 1.0
4log1p(v) = -0.153 + 0.0008139 * 23 0.973571 0.993482 9.16383 -219.208 -209.165 1.0 1.0
5log(v) = -7.4964 + 0.002674 * d 29 0.973545 0.993471 9.16841 -219.117 -209.073 1.0 1.0
6log1p(v) = -0.1395 + 0.0004409 * 32 0.973533 0.993473 9.17053 -219.075 -209.031 1.0 1.0
7log(v) = -12.5552 + 0.2311 * h + 33 0.973515 0.993499 9.17355 -219.015 -208.972 1.0 1.0
8log(v) = -7.4379 + 0.0007277 * d 42 0.973501 0.993461 9.17605 -218.965 -208.922 1.0 1.0
9log(v) = -10.1869 + 0.09427 * h 47 0.973454 0.993452 9.18411 -218.806 -208.762 1.0 1.0
10log1p(v) = -0.1662 + 0.002532 * 52 0.97339 0.993441 9.19527 -218.585 -208.541 1.0 1.0
```

### Biomass Regression Example
Expand All @@ -127,17 +144,16 @@ using DataFrames

# Sample biomass data
biomass = DataFrame(
arvore = 1:46,
d = [6.5, 8.0, 8.5, 8.5, 9.5, 9.5, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.2, 10.5, 10.5, 10.5, 11.0, 11.0, 11.0, 11.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.5, 12.5, 13.0, 13.0, 13.0, 13.0, 13.0, 13.5, 13.5, 14.0, 14.0, 14.0, 14.5, 14.5, 14.5, 14.5, 14.5, 15.0, 15.0, 15.5, 16.0],
h = [11.5, 15.2, 14.8, 17.0, 16.9, 19.8, 17.7, 19.0, 18.2, 15.8, 17.5, 17.8, 16.7, 18.0, 17.9, 16.0, 18.8, 17.1, 19.3, 19.5, 18.8, 20.0, 19.1, 16.8, 17.9, 19.7, 19.0, 19.9, 20.5, 20.1, 16.1, 19.3, 20.2, 19.2, 21.1, 21.2, 21.8, 18.9, 20.6, 20.6, 21.8, 22.2, 19.4, 20.5, 21.1, 21.3],
p = [5.832, 18.825, 16.065, 15.657, 23.476, 29.376, 25.247, 31.962, 31.954, 27.356, 25.163, 29.865, 23.391, 32.887, 38.719, 31.059, 31.689, 26.379, 36.608, 44.182, 37.616, 40.209, 45.496, 39.182, 40.036, 58.883, 56.035, 64.647, 65.173, 59.035, 33.082, 50.726, 53.361, 56.979, 77.001, 84.832, 77.141, 65.280, 65.389, 65.240, 76.359, 69.406, 71.757, 81.424, 100.448, 89.240]
)

# Build a regression model for biomass
model_biomass = regression(:p, :h, :d, biomass);
# Build a fitted regression models for biomass
fitted_biomass = regression(:p, :h, :d, biomass);

# You can evaluate and rank them based on specific criteria using the criteria_table function.
ct = criteria_table(model_biomass)
criteria_table(fitted_biomass)
10×9 DataFrame
Row │ model rank adjr2 d syx aic bic normality significance
│ LinearMo Int64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
Expand Down

0 comments on commit 827a8c7

Please sign in to comment.