Skip to content

Shortcut for homogenous networks give weird result on diagonal #30

Description

@JoFAM

I tried the following in test_shortcuts.R

  looE <- loo(modh)
  looEtest <- sapply(seq_len(ncol(Yh)),
                     function(y) sapply(seq_len(nrow(Yh)),
                                        function(x){Ytilde <- Yh
                                        Ytilde[x,y] <- looE[x,y]
                                        Ytilde[y,x] <- looE[x,y]
                                        predict_ij(Ytilde, Hkh, Hkh, x, y) }
                     )
  )

If I do so, all loo predictions are correctly calculated, except for the values on the diagonal. This is currently solved by simply ignoring the diagonal :

  looE <- loo(modh)
  looEtest <- sapply(seq_len(ncol(Yh)),
                     function(y) sapply(seq_len(nrow(Yh)),
                                        function(x){Ytilde <- Yh
                                        Ytilde[x,y] <- looE[x,y]
                                        Ytilde[y,x] <- looE[x,y]
                                        if(x == y) Ytilde[x,y] else
                                        predict_ij(Ytilde, Hkh, Hkh, x, y) }
                     )
  )

Is this enough or is there something going wrong in that procedure?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

PostponedThis will be tackled later

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions