R/phi_jl.r

Defines functions phi_jl phi_jl

Documented in phi_jl

phi_jl <- function(p, f, kj){

# compute inequality nr for given j, l

c <- p - f
kj0 <- c(rep(0, c), kj)
mjls <- NULL

for (j in (c+1):p){
    for (l in 2:(kj0[j]-1)){
        h <- (c+1):j
        i <- sum(kj0[h-1])+(l-1) - 2 * (j-c-1)
        mjls <- rbind(mjls, c(j, l, i))}
}
dimnames(mjls) <- list(NULL, c("j", "l", "i"))
return(mjls)
}


## neue Version (fuer >= 0 setting)
phi_jl <- function(p, f, kj){

# compute inequality nr for given j, l

c <- p - f
kj0 <- c(rep(0, c), kj)
mjls <- NULL

for (j in (c+1):p){
    for (l in 2:(kj0[j])){
        h <- (c+1):j
        i <- sum(kj0[h - 1]) + (l - 1) - (j - c - 1)
        mjls <- rbind(mjls, c(j, l, i))}
}
dimnames(mjls) <- list(NULL, c("j", "l", "i"))
return(mjls)
}

Try the OrdFacReg package in your browser

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

OrdFacReg documentation built on May 1, 2019, 10:06 p.m.