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

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)
#> # A tibble: 6,001 × 7
#>        x value fitted raw_sig     se abs_resid chop 
#>    <dbl> <dbl>  <dbl>   <dbl>  <dbl>     <dbl> <lgl>
#>  1 0     0.855  0.992 -0.137  0.0123    0.137  FALSE
#>  2 0.001 1.06   0.998  0.0588 0.0123    0.0588 FALSE
#>  3 0.002 1.12   1.00   0.119  0.0123    0.119  FALSE
#>  4 0.003 0.888  1.01  -0.123  0.0123    0.123  FALSE
#>  5 0.004 0.998  1.02  -0.0181 0.0122    0.0181 FALSE
#>  6 0.005 1.27   1.02   0.250  0.0122    0.250  FALSE
#>  7 0.006 0.877  1.03  -0.151  0.0122    0.151  FALSE
#>  8 0.007 1.17   1.03   0.136  0.0122    0.136  FALSE
#>  9 0.008 0.912  1.04  -0.128  0.0122    0.128  FALSE
#> 10 0.009 1.30   1.05   0.250  0.0122    0.250  FALSE
#> # … with 5,991 more rows