rmse.by.year: Root mean squared error (rmse) by year

Description Usage Arguments Value Examples

View source: R/rmse.R

Description

calculates the rmse between predicted and observed values for each year in a dataset.

Usage

1

Arguments

df

data frame with columns named "year", "obs", and "pred".

Value

returns a rmse value for each year

Examples

1
2
3
4
5
6
year <- c(rep(1,25),rep(2,25),rep(3,25))
obs <- c(1:75)
e <- c(rnorm(n=25,mean=0,sd=2),rnorm(n=25,mean=0,sd=10),rnorm(n=25,mean=0,sd=50))
pred <- obs + e
df <- data.frame(year,obs,pred)
rmse.by.year(df)

USGS-R/trainR documentation built on May 6, 2019, 10:12 a.m.