Learn R Programming

smint: Smooth Multivariate Interpolation for Gridded and Scattered Data

Installation

You can install the latest version of the code using the devtools R package.

# Install devtools, if you haven't already.
install.packages("devtools")

library(devtools)
install_github("IRSN/smint")

Usage

Complete user guide is here: smintGuide.pdf

Basic example:

     set.seed(12345)
     n <- 6; nout <- 300L
     x <- sort(runif(n))
     xout <- sort(runif(nout, min = x[1], max = x[n]))
     y <- sin(2 * pi * x)
     cI0 <- interp_ceschino(x = x, xout = xout, y = y)
     
     ## compare with a natural spline
     require(splines)
     spI <- interpSpline(x, y)
     spPred0 <- predict(spI, xout)
     
     plot(xout, sin(2 * pi * xout), type = "l", col = "black", lwd = 2,
          xlab = "x", ylab = "f(x)", main = "Interpolations")
     abline(v = x, col = "gray")
     lines(cI0, type = "l", col = "SpringGreen3", lty = 2, lwd = 2)
     lines(spPred0, type = "l", col = "SteelBlue2", lty = 3, lwd = 2)
     points(x, y, type = "p", pch = 21, col = "red",
            bg = "yellow", lwd = 2)
     legend("topright", legend = c("true", "Ceschino", "nat. spline"),
             col = c("black", "SpringGreen3", "SteelBlue2"),
             lty = 1:3, lwd = rep(2, 3))

Copy Link

Version

Install

install.packages('smint')

Monthly Downloads

20

Version

0.4.2

License

GPL-3

Maintainer

Yann Richet

Last Published

January 14th, 2016

Functions in smint (0.4.2)

aperm

Permutation of dimensions, or generalized transpose
smint-package

Multivariate Interpolation for Scattered Data and Gridded data
branin

Branin-Hoo 2-dimensional test function
checkX

Check designs: size and colnames
interp_ceschino

Ceschino cubic interpolation
ShepFun1

Test functions for/from SHEPPACK
qsheppInt

Shepard's (modified) quadratic interpolation method
cardinalBasis_lagrange

Cardinal Basis for Lagrange (broken line) interpolation
closest

Find closest point(s) in a design or object.
sampleIn

Sample from/in a design object
Grid

Create a new Grid object
apply_Grid

Apply a function to a Grid object.
Grid-class

Class "Grid"
scale_Grid

Scale a Grid object.
cardinalBasis_ceschino

Cardinal Basis for cubic Ceschino interpolation
cardinalBasis_natSpline

Cardinal Basis for natural cubic spline interpolation
interp_Grid

Grid interpolation in arbitrary dimension through Cardinal Basis
randGrid

Random drawing of a Grid object
as.Grid.default

Coercion to Grid
boundary_Grid

Find boundary points in a Grid object
range_Grid

Range of a Grid object
subset_Grid

Subgrid by selection of levels in one dimension.
drop_Grid

Drop the dimensions with a unique level in a Grid object
array_Grid

Reshape or coerce an array of responses
as.Grid

Coercion of objects to Grid
round_levels

Round a vector (of levels)