MyNixOS website logo
Description

Data Smoothing by Interpolating Cubic Splines.

We construct the explicit form of clamped cubic interpolating spline (both uniform - knots are equidistant and non-uniform - knots are arbitrary). Using this form, we propose a linear regression model suitable for real data smoothing.

ICSsmoothing

Library for data smoothing using interpolating splines

Basic usage examples

Load the library if installed.

library("ICSsmoothing")

The library consists one testing dataframe with two numeric columns x and y.

  • CERN, where CERN$x = [1, 2, ..., 277],

and five public functions

  • cics_unif_explicit(...) - create and plot the uniform explicit spline,

    cics_unif_explicit(
      uumin = CERN$x[1], # start spline at this x-coordinate
      uumax = CERN$x[10], # finish spline at this x-coordinate
      yy = CERN$y[1:10], # y-coordinates for spline control points
      d = c(0,0), # derivateves at points (uumin, yy[1]) and (uumax, yy[length(yy)])
      xlab="X axis", # x-axis label
      ylab="Y axis" # y-axis label
    )
    
  • cics_unif_explicit_smooth(...) - create and plot the uniform explicit spline as smoothing curve,

    cics_unif_explicit_smooth(
      xx = CERN$x, # x-coordinates to smooth
      yy = CERN$y, # y-coordinates to smooth
      k = 21, # number of components of a smoothing spline
      d = c(0, 1), # derivateves at points (uumin, yy[1]) and (uumax, yy[length(yy)])
      xlab = "X axis", # x-axis label
      ylab = "Y axis"
    )
    
  • cics_explicit(...) - create and plot the explicit spline,

    cics_explicit(
      uu = c(1, 2.2, 3, 3.8, 7), # x-coordinates for spline control points
      yy = CERN$y[1:5], # y-coordinates for spline control points
      d = c(0,0), # derivateves at points (uu[1], yy[1]) and (uu[length(uu)], yy[length(yy)])
      xlab="X axis", # x-axis label
      ylab="Y axis" # y-axis label
    )
    
  • cics_explicit_smooth(...) - create and plot the explicit spline as smoothing curve,

    cics_explicit_smooth(
      xx = CERN$x, # x-coordinates to smooth
      yy = CERN$y, # y-coordinates to smooth
      uu = c(1, 4, 7, 20, 41, 57, 86, 92, 101, 121, 220, 245, 261, 277), # # x-coordinates for spline control points. uu[1] == xx[1] and uu[length(uu)] == xx[length(xx)]
      d = c(0, 1), # derivateves at points (uumin, yy[1]) and (uumax, yy[length(yy)])
      xlab = "X axis", # x-axis label
      ylab = "Y axis"
    )
    
  • forecast_demo() - demo showing a usage of an explicit spline to forecast some data. See the commented source code of the function for more details about the functionality.

Building from source

Prerequisites

Depends on R packages

  • devtools
  • roxygen2
  • ggplot2

Installation

On Windows Windows run in R console (or RStudio)

install.packages("Rtools", force = TRUE)
library("Rtools")

On Linux (Ubuntu) install first these packages

sudo apt install libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev

In both cases then run in R console

devtools::install_github("klutometis/roxygen", force = TRUE)
library(roxygen2)
install.packages("digest")
library(digest)
install.packages("polynom")
library(polynom)
install.packages("ggplot2")
library(ggplot2)

Open system terminal in the parent directory of the package and type

R CMD build ICSsmoothing
R CMD install ICSsmoothing_1.2.8.tar.gz

OR Open RStudio and install this library using top menu button Build->Install and Restart.

Metadata

Version

1.2.8

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows