R/RcppExports.R

Defines functions rls_update_cpp lp_vector_cpp

Documented in lp_vector_cpp rls_update_cpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Low pass filtering of a vector.
#' 
#' This function returns a vector which is x through a unity gain first-order low-pass filter.
#'
#' @name lp_vector_cpp
#' @param x A numeric vector
#' @param a1 the first order low-pass filter coefficient
NULL

lp_vector_cpp <- function(x, a1) {
    .Call('_onlineforecast_lp_vector_cpp', PACKAGE = 'onlineforecast', x, a1)
}

#' Calculating k-step recursive least squares estimates
#' 
#' This function applies the k-step recursive least squares scheme to estimate
#' parameters in a linear regression model.
#'
#' @name rls_update_cpp
#' @param y Vector of observation
#' @param X Matrix of input variables (design matrix)
#' @param theta Vector of parameters (initial value)
#' @param P Covariance matrix (initial value)
#' @param lambda Forgetting factor
#' @param k Forecast horizon
#' @param n Length of the input
#' @param np Dimension of P (np x np)
#' @param istart Start index
#' @param kmax Keep only the last kmax rows for next time
NULL

rls_update_cpp <- function(y, X, theta, P, lambda, k, n, np, istart, kmax) {
    .Call('_onlineforecast_rls_update_cpp', PACKAGE = 'onlineforecast', y, X, theta, P, lambda, k, n, np, istart, kmax)
}

Try the onlineforecast package in your browser

Any scripts or data that you put into this service are public.

onlineforecast documentation built on Oct. 12, 2023, 5:15 p.m.