R/fFitKernelWeights.R

Defines functions fFitKernelWeights

Documented in fFitKernelWeights

#' Solve for the vector xi of kernel weights
#' 
#' @param CashflowMatrix A matrix of all cashflows, instruments in rows, times in columns
#' @param KernelFunctionMatrix A matrix of kernel function values
#' @param MarketValueVector A vector of market values of the insturments
#' @param BaseZeroVector A vector of "base" values for the zeros
#' 
fFitKernelWeights <- function( CashflowMatrix, KernelFunctionMatrix, MarketValueVector, BaseZeroVector ) {
	
	xi <- solve( CashflowMatrix %*% KernelFunctionMatrix %*% t( CashflowMatrix ) ) %*% ( MarketValueVector - CashflowMatrix %*% BaseZeroVector )
	
	return( xi )
	
}

Try the SmithWilsonYieldCurve package in your browser

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

SmithWilsonYieldCurve documentation built on May 2, 2019, 2:16 a.m.