            }
            sum_ur[j, k] <- ifelse(sum(u[1:I, j, k]) > 0,
                                   sum(u[1:I, j, k] * r[1:I, j, k]),
                                   1)
        }
    }

    # Availability of species sequence
    for (i in 1:I) {
        for (j in 1:J) {
            for (k in 1:K) {
