cc_fit_loess: Fit a loess curve to a bullet data frame

View source: R/loess.R

cc_fit_loessR Documentation

Fit a loess curve to a bullet data frame

Description

A loess regression is fit to the surface measurements and residuals are calculated. The most extreme 0.25% of residuals are filtered from further consideration. The result is called the raw signature of the bullet land. Adapted from fit_loess in bulletr

Usage

cc_fit_loess(ccdata, span = 0.75)

Arguments

ccdata

The crosscut as returned from x3p_to_df, grooves need to be removed ahead of time

span

The span to use for the loess regression

Value

a list of a data frame of the original bullet measurements extended by loess fit, residuals, and standard errors and two plots: a plot of the fit, and a plot of the bullet's land signature.

Examples

library(dplyr)
ccdata <- data_frame(
  x = seq(0, 6, .001),
  value = 10 - (3 - x)^2 + rnorm(length(x), sd = .25)
)
cc_fit_loess(ccdata = ccdata)

heike/bulletxtrctr documentation built on March 8, 2024, 7:41 p.m.