spl: The spline-based arrival rate function

Description Usage Arguments Value Examples

View source: R/spl.R

Description

This function returns the value of the spline at time t.

Usage

1
spl(t, knots, c)

Arguments

t

A scalar or vector of times at which the function will be evaluated

Value

The value of the spline function at t is returned

Examples

1
2
3
4
5
6
7
8
9
## spline-based intensity defined on [0,10]
d<-3      #spline function degree
knots<-seq(-3,13,by=1)
n<-length(knots)-(d+1)
c<-runif(n,1,5)
t<-1.5
spl(t,knots,c)  # the spline-based intensity evaluated at time 1.5
t<-seq(0,10,by=0.01)
plot(t,spl(t,knots,c),type="l") # a plot of the spline-based intensity over the interval [0,10]

morganle/NHPPspline documentation built on July 10, 2020, 7:07 p.m.