runRegression: Rolling regression for pollutant source characterisation.

View source: R/runRegression.R

runRegressionR Documentation

Rolling regression for pollutant source characterisation.

Description

This function calculates rolling regressions for input data with a set window width. The principal use of teh function is to identify "dilution lines" where the ratio between two pollutant concentrations is invariant. The original idea is based on the work of Bentley (2004).

Usage

runRegression(mydata, x = "nox", y = "pm10", run.len = 3, date.pad = TRUE)

Arguments

mydata

A data frame with colums for date and at least two variables for use in a regression.

x

The column name of the x variable for use in a linear regression y = m.x + c.

y

The column name of the y variable for use in a linear regression y = m.x + c.

run.len

The window width to be used for a rolling regression. A value of 3 for example for hourly data will consider 3 one-hour time sequences.

date.pad

Should gaps in time series be filled before calculations are made?

Details

The intended use is to apply the approach to air pollution data to extract consecutive points in time where the ratio between two pollutant concentrations changes by very little. By filtering the output for high R2 values (typically more than 0.90 to 0.95), conditions where local source dilution is dominant can be isolated for post processing. The function is more fully descfibed and used in the openair online manual, together with examples.

Value

A tibble with date and calculated regression coefficients and other information to plot dilution lines.

References

For original inspiration:

Bentley, S. T. (2004). Graphical techniques for constraining estimates of aerosol emissions from motor vehicles using air monitoring network data. Atmospheric Environment,(10), 1491–1500. https://doi.org/10.1016/j.atmosenv.2003.11.033

Example for vehicle emissions high time resolution data:

Farren, N. J., Schmidt, C., Juchem, H., Pöhler, D., Wilde, S. E., Wagner, R. L., Wilson, S., Shaw, M. D., & Carslaw, D. C. (2023). Emission ratio determination from road vehicles using a range of remote emission sensing techniques. Science of The Total Environment, 875. https://doi.org/10.1016/j.scitotenv.2023.162621.

See Also

Other time series and trend functions: TheilSen(), calendarPlot(), smoothTrend(), timePlot(), timeProp(), timeVariation(), trendLevel()

Examples

# Just use part of a year of data
output <- runRegression(selectByDate(mydata, year = 2004, month = 1:3),
x = "nox", y = "pm10", run.len = 3)

output

openair documentation built on May 29, 2024, 11:07 a.m.