R/mlnormal_proc_variance_shortcut_Z_R.R

Defines functions mlnormal_proc_variance_shortcut_Z_R

## File Name: mlnormal_proc_variance_shortcut_Z_R.R
## File Version: 0.10


mlnormal_proc_variance_shortcut_Z_R <- function( Z_list, Z_index, G, freq_id){

        gg0 <- freq_id[ 1, "orig_id" ]
        Z_list_gg0 <- Z_list[[gg0]]
        NZ <- length(Z_list_gg0)
        Z_index_gg0 <- Z_index[gg0,,]
        for (gg in 2:G){
            # gg <- 2
            gg1 <- freq_id[ gg, "orig_id" ]
            Z_list_gg <- Z_list[[gg1]]
            Z_index_gg <- Z_index[gg1,,]
            if ( freq_id[ gg, "update_dim"]==0 ){
                crit1 <- mlnormal_equal_matrix( mat1=Z_index_gg0, mat2=Z_index_gg )
                crit2 <- mlnormal_equal_list_matrices( list_mat1=Z_list_gg0,
                                list_mat2=Z_list_gg, dim_list=NZ)
                crit <- 1 * crit1 * crit2
                if ( crit==0 ){
                    freq_id[ gg, "update_dim" ] <- 1
                }
            }
            Z_list_gg0 <- Z_list_gg
            Z_index_gg0 <- Z_index_gg
            gg0 <- gg1
        }

    #--- output
    res <- list( "freq_id"=freq_id, "rcpp_args"=NULL)
    return(res)
}

Try the LAM package in your browser

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

LAM documentation built on May 18, 2022, 5:17 p.m.