valesta: Function to compute prediction statistics based on observed...

View source: R/valesta.r

valestaR Documentation

Function to compute prediction statistics based on observed values

Description

Computes three prediction statistics as a way to compare observed versus predicted values of a response variable of interest. The statistics are: the aggregated difference (AD), the root mean square differences (RMSD), and the aggregated of the absolute value differences (AAD). All of them area based on

r_i = y_i - \hat{y}_i

where y_i and \hat{y}_i are the observed and the predicted value of the response variable y for the i-th observation, respectively. Both the observed and predicted values must be expressed in the same units.

Usage

valesta(y.obs = y.obs, y.pred = y.pred)

Arguments

y.obs

observed values of the variable of interest

y.pred

predicted values of the variable of interest

Details

The function computes the three aforementioned statistics expressed in (i) as the units of the response variable and (i) as a percentage. Notice that to represent each statistic in percentual terms, we divided them by the mean observed value of the response variable.

Value

The main output following six prediction statistics as a vector: (RMSD, RMSD.p, AD, AD.p, AAD, AAD.p); where RMSD.p stands for RMSD expressed as a percentage, and the same applies to AD.p and AAD.p.

Author(s)

Christian Salas-Eljatib.

References

- Salas C, Ene L, Gregoire TG, Nasset E, Gobakken T. 2010. Modelling tree diameter from airborne laser scanning derived variables: a comparison of spatial statistical models. Remote Sensing of Environment 114(6):1277-1285. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.rse.2010.01.020")}

- Salas C. 2002. Ajuste y validación de ecuaciones de volumen para un relicto del bosque de roble-laurel-lingue. Bosque 23(2):81–92. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.4067/S0717-92002002000200009")}.

Examples


#Creates a fake dataframe
set.seed(1234)
df <- as.data.frame(cbind(Y=rnorm(30, 30,9), X=rnorm(30, 450,133)))
#fitting a candidate model
mod1 <- lm(Y~X, data=df)
#Using the valesta function
valesta(y.obs=df$Y,y.pred=fitted(mod1))

biometrics documentation built on April 4, 2025, 12:35 a.m.