R/mgsem_add_increment.R

Defines functions mgsem_add_increment

## File Name: mgsem_add_increment.R
## File Version: 0.04


mgsem_add_increment <- function(x, h, i1, i2=NULL, symm=FALSE )
{
    x1 <- x
    if (is.vector(x)){
        x1[i1] <- x[i1] + h
    } else {
        x1[i1,i2] <- x[i1,i2] + h
        if (symm & (i1!=i2) & (!is.null(i2)) ){
            x1[i2,i1] <- x1[i2,i1] + h
        }
    }
    return(x1)
}
alexanderrobitzsch/sirt documentation built on Sept. 8, 2024, 2:45 a.m.