build_gof_stats: Calculate goodness-of-fit statistics

View source: R/build_gof_stats.R

build_gof_statsR Documentation

Calculate goodness-of-fit statistics

Description

Calculates goodness-of-fit statistics beteween cross section geometry and regional hydraulic geometry dimensions.

Usage

build_gof_stats(xs_dims, streams, regions, bankfull_elevations)

Arguments

xs_dims

data frame; a data frame of cross section dimensions

streams

character vector; The stream names in the study area.

regions

character; The regions that a dimension will be calculated for. See the regional_curves$region field for a complete list.

bankfull_elevations

numeric vector; The bankfull elevations (units: detrended feet) that are used to calculate hydraulic geometry.

Details

This function uses the function Metrics::rmse to calculate the root mean square error statistic and the function Metrics::mae to calculate the mean absolute error statistic.

Add a description of how the goodness of fit calculation is made.

Value

A data frame of goodness of fit scores of the relationship between cross section geometry and regional hydraulic geometry dimensions.

reach_name

character; The name of the stream.

region

character; The name of the region.

bankfull_elevation

numeric; The detrended bankfull elevation (in feet) that is used to calculate hydraulic geometry.

rmse_area

numeric; The root-mean-square-error between the regional curve derived area and the cross section derived area.

rmse_width

numeric; The root-mean-square-error between the regional curve derived width and the cross section derived width.

rmse_depth

numeric; The root-mean-square-error between the regional curve derived depth and the cross section derived depth.

mae_area

numeric; The mean absolute error between the regional curve derived area and the cross section derived area.

mae_width

numeric; The mean absolute error between the regional curve derived width and the cross section derived width.

mae_depth

numeric; The mean absolute error between the regional curve derived depth and the cross section derived depth.

See Also

The xs_dims parameter is created using the xs_dimensions function.

Examples

# Extract attribute data from fluvgeo::sin_xs_points sf object
sin_xs_points_df <- fluvgeo::sin_riffle_channel_points_sf

# Set variable values
streams <- c("Sinsinawa")
regions <- c("Eastern United States", "IN Central Till Plain")
bankfull_elevations = seq(103, 104, 0.1)

# Call the xs_dimensions function
sin <- xs_dimensions(xs_points = sin_xs_points_df,
                     streams = streams,
                     regions = regions,
                     bankfull_elevations = bankfull_elevations)

# Call the build_gof_stats function
sin_gof <- build_gof_stats(xs_dims = sin,
                           streams = streams,
                           regions = regions,
                           bankfull_elevations = bankfull_elevations)


FluvialGeomorph/fluvgeo documentation built on April 12, 2024, 5:35 p.m.