GetPSplines: Simulate time series of fluctuations based on P-Splines

Description Usage Arguments Value See Also Examples

View source: R/getsplines.R

Description

Simulate function y = Ba where the a's are governed by P-spline process

Usage

1
GetPSplines(B.ik, sigma.alpha, order, seed = 123)

Arguments

B.ik

a matrix of B-Splines

sigma.alpha

variance of spline coefficients

order

order of penalization (either 1 or 2).

seed

value of random seed

Value

A list containing: a matrix of B-spline values; and a vector of knot locations.

See Also

GetSplines

Examples

1
2
3
4
5
6
x.i <- seq(1, 50, 1)
res <- GetSplines(x.i, I = 2.5)
nobs <- length(x.i)
sigma.alpha <- 0.01
y.i <- GetPSplines(res$B.ik, sigma.alpha, order = 1)
ggplot(data = NULL, aes(x = x.i, y = y.i)) + geom_line() + geom_point() + theme_bw()

MJAlexander/distortr documentation built on July 17, 2020, 4:06 p.m.