trend-spec: Specification of form of the trend within the nim formula.

Description Usage Arguments Value See also Examples

Description

The function specifying the trend are not meant to be used outside the formula of the nim function.

Usage

1
2
3
4
s(..., h = 0.1, eval_at = all, w = function(u) {     pmax(1 - u^2, rep(0,
  length(u))) })

p(...)

Arguments

...

The name of the covariate within the nim formula

h

Width of the smoothing window (bandwidth) as a fraction of the number of the time steps included in the window (for h <= 1) or as a number of time-steps (for h>1)

eval_at

Either numerical indices of the time series where to calculate the local regression estimates, all (defaults) or 'all' for evaluation at each time step. The outcome (smoothed parameter) are linearly approximated in order to provide value for each time step.

w

The kernel function - defaults to Epanechnikov kernel. Could be specified as a function of u: (-Inf, Inf) -> (0, 1), typically with largest values for u = 0.

Value

Returns the environment of the function.

See also

nim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data('precip_max')
head(precip_max)

# indicate which columns contain the extremes to be fitted
extremes(precip_max) = 2:ncol(precip_max)

# smooth trend in xi, with bandwidth h = 0.2
nim(xi ~ s(YR, h = 0.2), data = precip_max)

# linear trend in xi and gamma
nim(xi + g ~ p(YR), data = precip_max)

hanel/nim documentation built on Sept. 27, 2020, 3:13 a.m.