Skip to content

Prediction for Bernoulli model with covariates seems incorrect #2

@jchiquet

Description

@jchiquet

In reference to GrossSBM/sbm#3,

if the following couple of lines are correct,

Screenshot from 2021-04-29 13-50-49

Then it seems that the prediction function in the case of Bernoulli for LBM/SBM with covariates is unexact, isn't it ?

    B <- matrix(0, nrow(adj), ncol(adj))
    for (k in 1:length(covariates)) {
        B <- B + model_parameters[[Q]]$beta[k] * covariates[[k]]
    }
    if (membership_name == "LBM") {
        return(sigmo(memberships[[Q]]$Z1 %*% model_parameters[[Q]]$m %*% 
            t(memberships[[Q]]$Z2) + B))
    }
    else {
        return(sigmo(memberships[[Q]]$Z %*% model_parameters[[Q]]$m %*% 
            t(memberships[[Q]]$Z) + B))

It would be correct only of the Z are indicator matrices but they are posterior probabilities.

Am I missing something?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions