Package 'valmetrics'

Title: Metrics and Plots for Model Evaluation
Description: Functions for metrics and plots for model evaluation. Based on vectors of observed and predicted values. Method: Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg (2021). <doi:10.1111/SUM.12694>.
Authors: Kristin Piikki [aut, cre, cph], Johanna Wetterlind [aut, cph], Mats Soderstrom [aut, cph], Bo Stenberg [aut, cph]
Maintainer: Kristin Piikki <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2025-03-19 05:16:51 UTC
Source: https://github.com/cran/valmetrics

Help Index


ac

Description

Calculates the Agreement coefficient (AC) from observed and predicted values.

Usage

ac(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: larger is better.

Value

Agreement coefficient (AC).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Willmott, C. J. (1984). On the evaluation of model performance in physical geography. In Spatial statistics and models. Springer, Dordrecht, Netherlands.

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
ac(o=obs, p=pred)

adjr2

Description

Calculates the Adjusted R2 (adjr2) from observed values, predicted values and the number of model parameters.

Usage

adjr2(o, p, k)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

k

A number. The number of parameters in the model. Note that k includes the intercept, so for example, k is 2 for a linear regression model.

Details

Interpretation: larger is better. Adjusted R2 (adjr2) punishes complexity of models; a larger number of parameters (k) means a smaller adjr2 value.

Value

Adjusted R2 (adjr2)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
adjr2(o=obs, p=pred, k=2)

aic

Description

Calculates the Akaike information criterion (AIC) from observed values, predicted values, the number of observations and the number of model parameters.

Usage

aic(o, p, k)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

k

A number. The number of parameters in the model. Note that k includes the intercept, so for example, k is 2 for a linear regression model.

Details

Interpretation: smaller is better. Akaike information criterion (AIC) punishes complexity of models; a larger number of parameters (k) means a larger AIC value. As it is sensitive to the number of samples, AIC cannot easily be compared between datasets of different sizes.

Value

Akaike information criterion (AIC)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
aic(o=obs, p=pred, k=2)

allmetrics

Description

Calculates 31 different validation metrics from observed values and predicted values. For the calculation of some metrics also the number of model parameters are used.

Usage

allmetrics(o, p, k)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

k

A number. The number of parameters in the model. Note that k includes the intercept, so for example, k is 2 for a linear regression model.

Details

See respective functions.

Value

A data.frame with all validation metrics for which functions are defined in this package.

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
allmetrics(o=obs, p=pred, k=2)

e

Description

Calculates the Nash-Sutcliffe modelling efficiency (E) from observed and predicted values.

Usage

e(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: a value of 1 means that all predicted values are equal to the observed values. A value of 0 means that the predictions explain as much of the variation in the observed values as the mean of the observed values does. A negative value means that the predictions are less accurate the mean of the observed values.

Value

Nash-Sutcliffe modelling efficiency (E).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Nash, J. E., & Sutcliffe, J. V. (1970). River flow forecasting through conceptual models part I. A discussion of principles. Journal of hydrology, 10(3), 282-290.

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Wilks D. S. (2011) Statistical Methods in the Atmospheric Sciences, Academic Press, Oxford, UK.

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
e(o=obs, p=pred)

iqr

Description

Calculates the Inter-quartile range (IQR) from a vector of observed values.

Usage

iqr(o)

Arguments

o

A numeric vector. Observed values.

Details

The inter-quartile range (IQR) is the difference between the 75-percentile and the 25-percentile of the observed values.

Value

Inter-quartile range (IQR).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
iqr(o=obs)

lc

Description

Calculates the Lack of correlation (LC) from observed and predicted values.

Usage

lc(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Lack of correlation (LC)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Gauch H. G., Hwang J. G., & Fick G. W. 2003. Model evaluation by comparison of model based predictions and measured values. Agronomy Journal, 95(6), 1442-1446.

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
lc(o=obs, p=pred)

lccc

Description

Calculates Lin's concordance correlation coefficient (LCCC) from observed and predicted values.

Usage

lccc(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: Lin's concordance correlation coefficient (LCCC) can take values between -1 and 1. LCCC-values close to 1 indicate a strong concordance between predicted and observed values, while LCCC-values near -1 indicate a strong discordance. LCCC-values close to 0 indicate no concordance. In a plot of predicted values versus observed values, an LCCC-value of 1 means that the all data points are on the 1.1-line.

Value

Lin's concordance correlation coefficient (LCCC).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Lawrence, I., & Lin, K. (1989). A concordance correlation coefficient to evaluate reproducibility. Biometrics, 255-268.

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
lccc(o=obs, p=pred)

mad

Description

Calculates the Median absolute deviation (MAD) from observed and predicted values.

Usage

mad(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Median absolute deviation (MAD)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mad(o=obs, p=pred)

mae

Description

Calculates the Mean absolute error (MAE) from observed and predicted values.

Usage

mae(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. Similar to RMSE but less sensitive to large errors.

Value

Mean absolute error (MAE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mae(o=obs, p=pred)

mape

Description

Calculates the Mean absolute percentage error (MAPE) from observed and predicted values.

Usage

mape(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Mean absolute percentage error (MAPE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mape(o=obs, p=pred)

mare

Description

Calculates the Median absolute relative error (MARE) from observed and predicted values.

Usage

mare(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Median absolute relative error (MARE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mare(o=obs, p=pred)

mde

Description

Calculates the Median error (MdE) from observed and predicted values.

Usage

mde(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. Similar to mean error (bias) but less sensitive to large errors. Sometimes called bias.

Value

Median error (MdE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mde(o=obs, p=pred)

mdse

Description

Calculates the Median squared error (MdSE) from observed and predicted values.

Usage

mdse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Median squared error (MSE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mdse(o=obs, p=pred)

me

Description

Calculates the Mean error (ME) from observed and predicted values.

Usage

me(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. Sometimes called bias.

Value

Mean error (ME).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
me(o=obs, p=pred)

msdr

Description

Calculates the Mean squared deviation ratio (msdr) from observed and predicted values.

Usage

msdr(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: closer to 1 is better. Sometimes called standardised squared predictor error (SSPE) or scaled root mean squared error (SRMSE).

Value

Mean squared deviation ratio (msdr)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Voltz, M., & Webster, R. (1990). A comparison of kriging, cubic splines and classification for predicting soil properties from sample information. Journal of soil Science, 41(3), 473-490. (there called: standardized square deviation).

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
msdr(o=obs, p=pred)

mse

Description

Calculates the Mean squared error (MSE) from observed and predicted values.

Usage

mse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. This metric is sometimes called mean squared deviation (MSD or RMSD2).

Value

Mean squared error (MSE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
mse(o=obs, p=pred)

nmse

Description

Calculates the Normalized mean squared error (NMSE) from observed and predicted values.

Usage

nmse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Normalized mean squared error (NMSE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Park S. J., Vlek P. L. G. 2002. Environmental correlation of three-dimensional soil spatial variability: a comparison of three adaptive techniques. Geoderma, 109(1-2), 117-140.

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
nmse(o=obs, p=pred)

nrmse

Description

Calculates the Normalised RMSE (NRMSE) from observed and predicted values.

Usage

nrmse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. Normalised RMSE (NRMSE) is computed as the RMSE divided by the mean of the observed valeus. NRMSE is sometimes called Relative RMSE (rRMSE) or Root mean square standardized (RMSS).

Value

Normalised RMSE (NRMSE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
nrmse(o=obs, p=pred)

nu

Description

Calculates the Non-unity slope (NU) from observed and predicted values.

Usage

nu(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: closer to 1 is better.

Value

Non-unity slope (NU)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
nu(o=obs, p=pred)

precision

Description

Calculates the Precision from observed and predicted values.

Usage

precision(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Precision

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
precision(o=obs, p=pred)

r

Description

Calculates the Pearson product moment correlation coefficient (r) from observed and predicted values.

Usage

r(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: larger absolute value is better.

Value

Pearson product moment correlation coefficient (r).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
r(o=obs, p=pred)

r2

Description

Calculates the Coefficient of determination (R2) from observed and predicted values.

Usage

r2(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: larger is better.

Value

Coefficient of determination (R2)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
r2(o=obs, p=pred)

rmdse

Description

Calculates the Root median squared error (RMdSE) from observed and predicted values.

Usage

rmdse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Root median squared error (RMdSE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
rmdse(o=obs, p=pred)

rmse

Description

Calculates the Root mean square error (RMSE) from observed and predicted values.

Usage

rmse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better. RMSE is sometimes abbreviated RMS, RMSD or RMSEP. A smaller value means a smaller error. RMSE is similar to mean absolute error (MAE), median absolute deviation (MAD) and root median squared error (RmdSE) but is more sensitive to large errors.

Value

Root mean square error (RMSE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
rmse(o=obs, p=pred)

rpd

Description

Calculates the Ratio of performance to deviation (RPD) from observed and predicted values.

Usage

rpd(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: larger is better.

Value

Ratio of performance to deviation (RPD).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom & Bo Stenberg [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
rpd(o=obs, p=pred)

rpiq

Description

Calculates the Ratio of interquartile to RMSE (RPIQ) from observed and predicted values.

Usage

rpiq(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: Smaller is better.

Value

Ratio of interquartile to RMSE (RPIQ)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom & Bo Stenberg [email protected]

References

Bellon-Maurel V., Fernandez-Ahumada E., Palagos B., Roger J. M., McBratney, A. 2010. Critical review of chemometric indicators commonly used for assessing the quality of the prediction of soil attributes by NIR spectroscopy. TrAC Trends in Analytical Chemistry, 29(9), 1073-1081.

Piikki K., Wetterlind J., Soderstrom M. Stenberg B. Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management, in press.

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
rpiq(o=obs, p=pred)

sde

Description

Calculates the Standard deviation of the error (SDE) from observed and predicted values.

Usage

sde(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Standard deviation of the error (SDE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
sde(o=obs, p=pred)

skew

Description

Calculates the Skewness of residuals from observed and predicted values.

Usage

skew(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Skewness of residuals.

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
skew(o=obs, p=pred)

smape

Description

Calculates the Symmetrical mean percentage error (SMAPE) from observed and predicted values.

Usage

smape(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Symmetrical mean percentage error (SMAPE)

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

References

Forkuor G., Hounkpatin O. K., Welp G., Thiel, M. 2017. High resolution mapping of soil properties using remote sensing variables in south-western Burkina Faso: a comparison of machine learning and multiple linear regression models. PloS one, 12(1), e0170478.

Piikki K., Wetterlind J., Soderstrom M., Stenberg B. (2021). Perspectives on validation in digital soil mapping of continuous attributes. A review. Soil Use and Management. doi:10.1111/sum.12694

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
smape(o=obs, p=pred)

sse

Description

Calculates the sum of squares for error (SSE) from observed and predicted values.

Usage

sse(o, p)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

Details

Interpretation: smaller is better.

Value

Sum of squares for error (SSE).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 2, 4, 5, 6, 8, 7, 10)
sse(o=obs, p=pred)

sst

Description

Calculates the Total sums of squares (SST) from a vector of observed values.

Usage

sst(o)

Arguments

o

A numeric vector. Observed values.

Details

Interpretation: smaller is better.

Value

Total sums of squares (SST).

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
sst(o=obs)

valplot

Description

Plots predicted values versus observed values in a coordinate system with the same range of both axes.

Usage

valplot(
  o,
  p,
  main = NA,
  sub = NA,
  xlab = "Observed value",
  ylab = "Predicted value"
)

Arguments

o

A numeric vector. Observed values.

p

A numeric vector. Predicted values.

main

A character value. The main title of the plot.

sub

A character value. The subtitle of the plot.

xlab

A character value. The x axis label.

ylab

A character value. The y axis label.

Details

Circles represent the data, dashed line represents observed = predicted and solid line represents an

Value

A scatter plot of observed and predicted values.

Author(s)

Kristin Piikki, Johanna Wetterlind, Mats Soderstrom and Bo Stenberg, E-mail: [email protected]

Examples

obs<-c(1:10)
pred<-c(1, 1 ,3, 5, 4, 5, 6, 8, 11, 10)
t1='Measured variable (unit)'
evalue<-round(e(o=obs, p=pred),2)
maevalue<-round(mae(o=obs, p=pred),1)
t2=paste('E = ', evalue, '; MAE = ', maevalue, ' units')
valplot(o=obs, p=pred, main=t1, sub=t2)