Description Usage Arguments Details Value Examples
Computes local linear predictions using Friedman's super smoother (Friedman, 1984)
1 | supsmu_fit(x, y, span = NULL, bass = 0)
|
x |
A numeric vector corresponding to the independent variable |
y |
A numeric vector corresponding to the dependent variable |
span |
The proportion of datapoints to include in the local fit (Optional) |
bass |
A value between 0 and 10 that controls the smoothness of the predictions (See Details) |
If the span argument is specified, then a fixed span is used for each x value to estimate the local linear regression line, and the bass argument is ignored. Otherwise, the span is selected for each point via cross-validation, as in Friedman, 1984. For the variable span algorithm, bass values closer to 10 result in a smoother-looking curve. Note that ties in the x variable are treated as distinct points, which is different from the behavior of stats::supsmu() (this function's method for handling ties is undocumented).
A numeric vector of super smoother predictions for the y variable at each value of the x variable (sorted by the x variable)
1 2 3 4 5 | x=(1:1000)
y=x+rnorm(1000,5,500)
supsmu_fit(x,y,span=0.2)
supsmu_fit(x,y,bass=5)
supsmu_fit(x,y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.