Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ang

Angular Term for a Locfit model.


Description

The ang() function is used in a locfit model formula to specify that a variable should be treated as an angular or periodic term. The scale argument is used to set the period.

ang(x) is equivalent to lp(x,style="ang").

Usage

ang(x,...)

Arguments

x

numeric variable to be treated periodically.

...

Other arguments to lp.

References

Loader, C. (1999). Local Regression and Likelihood. Springer, NY (Section 6.2).

See Also

Examples

# generate an x variable, and a response with period 0.2
x <- seq(0,1,length=200)
y <- sin(10*pi*x)+rnorm(200)/5

# compute the periodic local fit. Note the scale argument is period/(2pi)
fit <- locfit(y~ang(x,scale=0.2/(2*pi)))

# plot the fit over a single period
plot(fit)

# plot the fit over the full range of the data
plot(fit,xlim=c(0,1))

locfit

Local Regression, Likelihood and Density Estimation

v1.5-9.4
GPL (>= 2)
Authors
Catherine Loader [aut], Jiayang Sun [ctb], Lucent Technologies [cph], Andy Liaw [cre]
Initial release
2020-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.