R/revSigUnwtd.R

Defines functions revSigUnwtd

Documented in revSigUnwtd

revSigUnwtd <- function(phi,X,y,state) {
#
# Rough as guts.
#
    yhat <- X%*%phi
    rrr  <- y-yhat
    srr  <- split(rrr,f=state)
    sigma <- sapply(srr,sd,na.rm=TRUE)
    names(sigma) <- paste0("sigma",1:length(sigma))
    sigma
}

Try the eglhmm package in your browser

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

eglhmm documentation built on May 29, 2024, 1:20 a.m.