# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
EstepCpp <- function(y, H, Q, R, F, x0, P0) {
.Call('dynfactoR_EstepCpp', PACKAGE = 'dynfactoR', y, H, Q, R, F, x0, P0)
}
#' Implementation of a Kalman filter
#' @param y Data matrix
#' @param F Observation matrix
#' @param Q State covariance
#' @param R Observation covariance
#' @param A Transition matrix
#' @param x0 Initial state vector
#' @param P0 Initial state covariance
#' @return A list with estimates
KalmanFilterCpp2 <- function(y, F, Q, R, A, x0, P0) {
.Call('dynfactoR_KalmanFilterCpp2', PACKAGE = 'dynfactoR', y, F, Q, R, A, x0, P0)
}
#' Implementation of a Kalman filter
#' @param y Data matrix
#' @param H Observation matrix
#' @param Q State covariance
#' @param R Observation covariance
#' @param F Transition matrix
#' @param x0 Initial state vector
#' @param P0 Initial state covariance
KalmanFilter <- function(y, H, Q, R, F, x0, P0) {
.Call('dynfactoR_KalmanFilter', PACKAGE = 'dynfactoR', y, H, Q, R, F, x0, P0)
}
#' Runs a Kalman smoother
#' @param A transition matrix
#' @param F observation matrix
#' @param R Observation covariance
#' @param xitt State estimates
#' @param xittm State predicted estimates
#' @param Ptt1 Variance estimates
#' @param Pttm1 Predicted variance estimates
#' @return List of smoothed estimates
KalmanSmootherCpp <- function(A, F, R, xitt, xittm, Ptt1, Pttm1) {
.Call('dynfactoR_KalmanSmootherCpp', PACKAGE = 'dynfactoR', A, F, R, xitt, xittm, Ptt1, Pttm1)
}
#' Runs a Kalman smoother
#' @param F transition matrix
#' @param H observation matrix
#' @param R Observation covariance
#' @param xfT State estimates
#' @param xpTm State predicted estimates
#' @param PfT_v Variance estimates
#' @param PpT_v Predicted variance estimates
#' @return List of smoothed estimates
KalmanSmoother <- function(F, H, R, xfT, xpT, PfT_v, PpT_v) {
.Call('dynfactoR_KalmanSmoother', PACKAGE = 'dynfactoR', F, H, R, xfT, xpT, PfT_v, PpT_v)
}
#' Implementation of Kim filter (1994), an extension to Kalman filter
#' for dynamic linear models with Markov-switching parameters. Currently,
#' Markov switching is assumed to happen only in observation and/or
#' transition matrices.
#'
#' @param y Data matrix (\code{T x n})
#' @param R Observation equation covariance
#' @param Q State equation covariance
#' @param F1 Array of observation matrices, one matrix per state
#' @param A1 Array of transition matrices, one matrix per state
#' @param x0 Initial condition for state vector
#' @param P0 Initial condition for state covariance matrix
#' @param p Markov transition probability matrix
#' @return a list with estimates
KimFilterCpp <- function(y, R, Q, F1, A1, x0, P0, p) {
.Call('dynfactoR_KimFilterCpp', PACKAGE = 'dynfactoR', y, R, Q, F1, A1, x0, P0, p)
}
KimSmoother <- function(F1, xA1, Pa1, x1, P1, stateP, stateP_fut, p) {
.Call('dynfactoR_KimSmoother', PACKAGE = 'dynfactoR', F1, xA1, Pa1, x1, P1, stateP, stateP_fut, p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.