sincos: Sinusoidal Basis Generating Function

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/shapes.r

Description

Generate a basis for a sinusoidal function at some fixed period

Usage

1
sincos(period, n = NULL, largest.period = 365)

Arguments

period

a numeric value indicating the seasonal pattern period

n

an integer indicating the number of observations

largest.period

a numeric value indicating the largest seasonal pattern period. Default is an year or 365 days

Details

This function returns a two-column matrix containing both sine and cosine component evaluated at the given period. The columns are named accordingly.

The function is designed to be used directly from within a formula. Therefore, there is no need to create the sine and cosine vectors prior to the fitting process.

When using with the ares library, n may be omitted and it will be taken from the length of ares.selection.

Value

A two-column matrix containing sine and cosine

Author(s)

Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br

References

Schwartz, J., Spix, C., Touloumi, G. et al. (1996) Methodological issues in studies of air pollution and daily counts of deaths or hospital admissions. J Epidemiol. Community Health 50 (suppl 1), S12–S18.

Box, G., Jenkins, G., Reinsel, G. (1994) Time Series Analysis : Forecasting and Control. 3 ed., Prentice Hall.

Diggle, P. J. (1990) Time Series : A Biostatistical Introduction. Oxford University Press.

See Also

fit_core,get_residuals

Examples

1
2
3
4
5
data(admrio)
setup(admrio,"date")
f <- resp5~s(time)+weekdays+s(tmpmax)+s(humid)+sincos(90)+sincos(180)
m <- fit_core(f)
print_summary(m)

wjunger/ares documentation built on Dec. 23, 2021, 5:17 p.m.