#' Mean function for EM
#'
#' Mean function for EM
#' @param theta parameters to be estimated
#' @param n.mixt number of mixture.
#' @param basis temporal basis expansion
#' @keywords mean function
#' @export
#' @examples
#' data("wq_analysis_week2")
#' SPTMData(wq.raw.obs, frequency = "quarter")
meanFuncSplines = function(theta, n.mixt = 4, basis,...){
weights = matrix(theta[(n.mixt+1):(length(theta) - n.mixt)], ncol = n.mixt)
res = basis %*% weights + matrix(theta[1:n.mixt], ncol = n.mixt, nrow = nrow(basis), byrow= T)
return(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.