MyNixOS website logo
Description

MULTIplex NEtworks with Shared Structure.

Model fitting and simulation for Gaussian and logistic inner product MultiNeSS models for multiplex networks. The package implements a convex fitting algorithm with fully adaptive parameter tuning, including options for edge cross-validation. For more details see MacDonald et al. (2020).

MultiNeSS

The R package “multiness” implements model fitting and simulation for Gaussian and logistic inner product MultiNeSS models for multiplex networks. The package uses a convex fitting algorithm with fully adaptive parameter tuning, including options for edge cross-validation. For more details see MacDonald et al., (2020).

Installation

You can install the development version of “multiness” from GitHub using

devtools::install_github("peterwmacd/multiness")

Example

“multiness” includes an example multiplex network of agricultural trade which is studied in MacDonald et al., (2020). It is easy to import and to fit a Gaussian MultiNeSS model with adaptive tuning.

library(multiness)

# import data
data(agri_trade)
dim(agri_trade)
#> [1] 145 145  13

# log transformation for edge weights
A <- log(1+agri_trade)

# model fit
fit <- multiness_fit(A,model="gaussian",self_loops=FALSE,
                     tuning="adaptive",tuning_opts=list(penalty_const=3),
                     optim_opts=list(max_rank=100,return_posns=TRUE))

# inspect fitted latent space dimensions
# common latent space
fit$d1
#> [1] 30
# individual latent spaces
fit$d2
#>  [1]  2  4  4  3  4  8  5  5 16 11  4 12  6

# plot first two common latent dimensions
plot(fit$V_hat[,1:2],main="Common latent dimensions",
     xlab="v1",ylab="v2",xlim=c(0,4.5))
# label a subset of the points
countries <- dimnames(A)[[1]]
do_label <- c(4,5,8,10,11,14,17,19,20,24,25,28,33,34,35,37,39,41,54,61,75)
text(fit$V_hat[do_label,1],fit$V_hat[do_label,2],
     labels=countries[do_label],pos=4,cex=.8)
Metadata

Version

1.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows