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

seq_min_max_eps

Create a sequence of evenly-spaced values adjusted to accommodate a small adjustment


Description

Creates a sequence of n evenly-spaced values over the range min(x)max(x), where the minimum and maximum are adjusted such that they are always contained within the range of x when x may be shifted forwards or backwards by an amount related to eps. This is particularly useful in computing derivatives via finite differences where without this adjustment we may be predicting for values outside the range of the data and hence the conmstraints of the penalty.

Usage

seq_min_max_eps(x, n, order, type = c("forward", "backward", "central"), eps)

Arguments

x

numeric; vector over which evenly-spaced values are returned

n

numeric; the number of evenly-spaced values to return

order

integer; the order of derivative. Either 1 or 2 for first or second order derivatives

type

character; the type of finite difference used. One of "forward", "backward", or "central"

eps

numeric; the finite difference

Value

A numeric vector of length n.


gratia

Graceful 'ggplot'-Based Graphics and Other Functions for GAMs Fitted Using 'mgcv'

v0.6.0
MIT + file LICENSE
Authors
Gavin L. Simpson [aut, cre] (<https://orcid.org/0000-0002-9084-8413>), Henrik Singmann [ctb] (<https://orcid.org/0000-0002-4842-3657>)
Initial release
2021-04-17

We don't support your browser anymore

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