compute_lowCurve: Compute loess curves for smoothing matrix

View source: R/functions_range.R

compute_lowCurveR Documentation

Compute loess curves for smoothing matrix

Description

Calculates a loess curve for the smoothing matrix entries, as a function of distance between points.

Usage

compute_lowCurve(S, D, newd, cl = NULL, span = 0.1)

Arguments

S

Smoothing matrix, or a subset of columns from a smoothing matrix.

D

Distance matrix, or a subset of columns from a distance matrix.

newd

Distances to use for loess prediction.

cl

Cluster object, or number of cluster instances to create. Defaults to no parallelization.

span

Passed to fitLoess

Details

For each column in S, a loess curve is fit to the values as a function of the distances between points, which are taken from the columns of D. Thus, the order of rows and columns in S should match the order of rows and columns in D. For a large number of locations, this procedure may be somewhat slow. The cl argument can be used to parallelize the operation using clusterMap.

See Also

computeS fitLoess

Examples


xloc <- runif(n=100, min=0, max=10)
X <- splines::ns(x=xloc, df=4, intercept=TRUE)
S <- computeS(X)
d <- as.matrix(dist(xloc))
xplot <- 0:10
lC <- compute_lowCurve(S, D=d, newd=xplot)
matplot(xplot, lC$SCurve, type="l", col="black")
points(xplot, lC$SCurveMedian, type="l", col="red")

jpkeller/spconf documentation built on March 11, 2024, 9:32 a.m.