R/RcppExports.R

Defines functions thetafun outerG thetafunG

Documented in outerG thetafun thetafunG

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Spline function.
#'
#' @description Function to fit the L2 spline using some Greens function.
#'
#' @param t Numeric vector of evaluation times.
#' @param y Numeric vector to be fitted.
#' @param gfun Integer value 1-10 (choice of Greens function).
#' @param lambda Numeric (smoothness parameter).
#'
#' @return Numeric vector of fitted values.
#'
#' @author Helene Charlotte Rytgaard
#' @examples
#' t = generate.t(m = 25); y = generate.y()(t) + generate.noise(t, type = 2)
#' plot(t, y, col = "blue")
#' lines(t, thetafun(t, y, 9, lambda = 0.0001))
#' @export
thetafun <- function(t, y, gfun, lambda) {
    .Call('L1splines_thetafun', PACKAGE = 'L1splines', t, y, gfun, lambda)
}

#' @title Outer function for gfun.
#'
#' @description Function to compute the matrix of Green's function evaluation for any two vectors t and tp.
#'
#' @param t Numeric vector of observation times.
#' @param tp Numeric vector evaluation times.
#' @param gfun Integer value 1-10 (choice of Greens function).
#' @param inv Logical (want inverse matrix or not)
#'
#' @return Numeric vector of fitted values.
#'
#' @author Helene Charlotte Rytgaard
#' @export
outerG <- function(t, tp, gfun, inv) {
    .Call('L1splines_outerG', PACKAGE = 'L1splines', t, tp, gfun, inv)
}

#' @title General solution, Green's spline.
#'
#' @description Function that takes the observations and computes the general spline solution. Must be combined with outerG() to obtain solution in some set of points.
#'
#' @param t Numeric vector of observation times.
#' @param y Numeric vector of observations.
#' @param gfun Integer value 1-10 (choice of Greens function).
#' @param lambda Numeric (smoothness parameter).
#'
#' @return Numeric vector of fitted values.
#'
#' @author Helene Charlotte Rytgaard
#' @export
thetafunG <- function(t, y, gfun, lambda) {
    .Call('L1splines_thetafunG', PACKAGE = 'L1splines', t, y, gfun, lambda)
}
helenecharlotte/L1splines documentation built on May 17, 2019, 3:24 p.m.