Skip to content

Commit

Permalink
version 2.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Salter-Townshend authored and cran-robot committed Mar 22, 2023
1 parent 99356f8 commit a6dcea1
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 60 deletions.
20 changes: 0 additions & 20 deletions CHANGELOG

This file was deleted.

8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: VBLPCM
Type: Package
Title: Variational Bayes Latent Position Cluster Model for Networks
Version: 2.4.8
Date: 2021-10-06
Version: 2.4.9
Date: 2023-03-22
Author: Michael Salter-Townshend
Maintainer: Michael Salter-Townshend <mike.saltertownshend@gmail.com>
Description: Fit and simulate latent position and cluster models for network data, using a fast Variational Bayes approximation developed in Salter-Townshend and Murphy (2013) <doi:10.1016/j.csda.2012.08.004>.
Expand All @@ -13,6 +13,6 @@ URL: https://www.r-project.org, https://mststats.github.io/#software
License: GPL (>= 2)
LazyLoad: yes
NeedsCompilation: yes
Packaged: 2021-10-06 09:37:25 UTC; mst
Packaged: 2023-03-22 15:36:25 UTC; mst
Repository: CRAN
Date/Publication: 2021-10-06 11:30:16 UTC
Date/Publication: 2023-03-22 16:10:02 UTC
22 changes: 11 additions & 11 deletions MD5
@@ -1,13 +1,13 @@
f0fa7bc5a911baef4e7544ac79973a3f *CHANGELOG
bf5ba392c2695ae95fc507dafd9905db *DESCRIPTION
da58a6ef3a05730d790b1928d9d7d564 *DESCRIPTION
1d69d4741adbf48761e664579cf6b9ee *NAMESPACE
01d48538efa577a3b1d341d06c097bea *R/KL.R
59018b906a56eadb7f679bce30658b81 *R/VBLPCM.R
912ab6f8dffb1ccc32485d43cc0c7ac9 *R/adjacency_to_edges.R
18c8f25668b8db1334dd6b9cc673ca67 *NEWS.md
18f699564ffd5acf7c55c941388b6996 *R/KL.R
71fc7bed8d0f0c2b107c5720333a69e7 *R/VBLPCM.R
f3fcd0fa87afe63a1e21a30acba6430a *R/adjacency_to_edges.R
124931b1ae2da9856a9bed1beb43047d *R/covs.R
c37a1721e1022d3894d1ff487a0f6829 *R/fruchterman_reingold.R
5c5d0d589c865ad25bbc5d191697f416 *R/fruchterman_reingold.R
cf57d570a3892125e33517728de7664b *R/gof.vblpcm.R
8c56de4663246b2207ade78a50a52ba1 *R/log_like_forces.R
93c2e234555761bad9494b767d6be9df *R/log_like_forces.R
9fc252b68a6dc43a2bc8d97ab3f07f53 *R/plot_network.R
6d0b56049f54c59dbe71754983a9a80d *R/predict.R
203861162888e86a84e9b20d62f2d8ba *R/print.vblpcm.R
Expand All @@ -16,17 +16,17 @@ f2399d5414a7daef462ea7f027bab6bb *R/start.R
4f69c86b26fbc64b90e83eb39a6ac450 *R/summarise_groups.R
054e8f388ac9c8373ab5b6e66818754e *R/summary.vblpcm.R
31c8ccdf29df94b0f5f9508fcb1a7e9e *R/vb_bic.R
31cf9d5d81f03b2dd6cf446936301a3b *R/zzz.R
41a2dc869b99e0cc97d104891504d121 *R/zzz.R
4cda533c9aac1b3aa6d890381c4dd46c *cleanup
7b0797ae9bdf1a440fef9986bfc3f6b0 *configure
230471d9e64e9216efae1ab64933a57d *configure.ac
013778ff539b989141783da07f3ddd03 *data/aids.rda
375a6d94bfb6ff8b879de44250fff5d3 *data/sampson.rda
1276843b63a1602933616b872ee9317f *data/simulated.network.rda
9beed6138652a9e4ebedd2cb1f270acb *inst/CITATION
de46b485251bd27fc99e78d4b0761c28 *inst/CITATION
4ccabdb12a6c7592d26cceab34755ee0 *man/E_to_Y.Rd
62b220ff6a4b95449f21d7eabbbd5848 *man/VBLPCM-internal.Rd
947bed8ddafc3495d5be6a2ea23d5af3 *man/VBLPCM-package.Rd
6fe271e0efa8e92c70139c8b559be67e *man/VBLPCM-package.Rd
1d21ac5b8c3d8909d4782465e94cec14 *man/Y_to_E.Rd
0eb794fe9b2faea92c95f0146560ac1a *man/Y_to_M.Rd
a3d9e7566f96741ba738afda6cade6d7 *man/Y_to_nonE.Rd
Expand Down Expand Up @@ -58,6 +58,6 @@ b64c69878f210fcd2b8a05890f9046d1 *src/bb.c
61a39c5900a8b02859418ac8e209e974 *src/fruchterman_reingold.c
c762448b2281f5119d26973664245846 *src/funcs.c
c650981e26f8f648c6683057bcf8234b *src/headers.h
26182edc32dd38686277085e02ff5716 *src/init.c
4479cb25085b79fe3d92e36bf643a879 *src/init.c
58af03653b50ae580943f91e0301adf7 *src/likelihoods.c
e98595aa0e3f407d16e37832b92f7449 *src/ll_layout.c
49 changes: 49 additions & 0 deletions NEWS.md
@@ -0,0 +1,49 @@
# VBLPCM 2.4.9

* Added a `NEWS.md` file to track changes to the package.

* fixed issue of "DLL requires the use of native symbols" by changing strings to symbols and using .fixes="C_" in useDynLib _2023/03_

# VBLPCM 2.4.8

* mirroring on github _2022/05_

* updated configure script using autoupdate _2021/10_

* removed use of externs in src .c files, now passing pointers to structs _2020/12_

* using useDynLib now for compatibility with new R versions _2020/12_

* had to change name of log_like_forces.c to ll_layout.c as was not compiling. Odd error resolved but not understood. _2020/10_

* changed use of deprecated plot.gofobject function from ergm to plot.gof and added cleanup script. _2018/10_

* updated GSL requirements; added imports of 'sna' functions; added network to depends; shortened BIC example. _2015/12_

* removed inv_sigma02 term from omega2 update (thanks to Robin Gong). _2014/01_

* fixed bug in use of start function when using largest connected component only and edge covariates. _2014/01_

* checked for leaks using AddressSanitizer, moved some Depends to Imports. _2013/10_

* now if mclust fails Fruchterman-Reingold is (re)called until mclust can find clusters. _2013/05_

* changed setting of seed. A single set.seed is now used. _2013/05_

* plugged memory leak due do diagonal of sociomatrix and corrected case-control usage. _2013/04_

* fixed bug in convergence check for V_xi_* and V_psi2_* (thanks for Triona Ryan). _2013/04_

* fixed bug in random effects updates and tweaked plot function. _2013/02_

* fixed bug in predict function for random effects models. _2013/02_

* changed onAttach to onLoad in zzz.R _2013/01_

* fixed bugs in handling of nodal covariates and cast same as sender, receiver or social. _2012/08_

* working startup message. _2012/08_

* fixed V_xi_e and V_psi2_e update bug (thanks to Sebastian Leist). _2012/08_

* changed to mclustBIC in vblpcmstart function for compatibility with mclust 4. _2012/07_
2 changes: 1 addition & 1 deletion R/KL.R
Expand Up @@ -40,7 +40,7 @@ vblpcmKL<-function(x)
NC=x$NC
KL=0
imodel=switch(model, plain=0, rsender=1, rreceiver=2, rsocial=3)
final_KL<-.C("KL_total", NAOK=TRUE,
final_KL<-.C(C_KL_total, NAOK=TRUE,
imodel=as.integer(imodel), P_n=as.integer(P_n),P_e=as.integer(P_e),D=as.integer(d), N=as.integer(N),
NE=as.integer(NE), NnonE=as.integer(NnonE), NM=as.integer(NM),
G=as.integer(G), Y=as.numeric(t(Y)), E=as.integer(t(E)), nonE=as.integer(t(nonE)), M=as.integer(t(M)),
Expand Down
2 changes: 1 addition & 1 deletion R/VBLPCM.R
Expand Up @@ -52,7 +52,7 @@ vblpcmfit<-function(variational.start, STEPS=50, maxiter=100, tol=1e-6, NC=NULL,
inv_sigma02<-variational.start$inv_sigma02
imodel=switch(model, plain=0, rsender=1, rreceiver=2, rsocial=3)
conv=0 # not converged to start with
out<-.C("Rf_VB_bbs", NAOK=TRUE, imodel=as.integer(imodel), steps=as.integer(STEPS), max_iter=as.integer(maxiter), P_n=as.integer(P_n),
out<-.C(C_Rf_VB_bbs, NAOK=TRUE, imodel=as.integer(imodel), steps=as.integer(STEPS), max_iter=as.integer(maxiter), P_n=as.integer(P_n),
P_e=as.integer(P_e), D=as.integer(d), N=as.integer(N), NE=as.integer(NE), NnonE=as.integer(NnonE), NM=as.integer(NM),
G=as.integer(G), Y=as.numeric(t(Y)), E=as.integer(t(E)), nonE=as.integer(t(nonE)), M=as.integer(t(M)),
numedges=as.integer(t(numedges)), EnonE=as.integer(t(EnonE)), diam=as.integer(diam),
Expand Down
8 changes: 4 additions & 4 deletions R/adjacency_to_edges.R
@@ -1,28 +1,28 @@
Y_to_E<-function(N, NE, directed, Y)
{
E<-matrix(NaN,NE,2)
ans<-.C("Y_to_E", NAOK=TRUE, N=as.integer(N),
ans<-.C(C_Y_to_E, NAOK=TRUE, N=as.integer(N),
directed=as.integer(directed), Y=as.numeric(t(Y)), E=as.integer(t(E)))
return(t(matrix(ans$E,2)))
}
Y_to_nonE<-function(N, NnonE, directed, Y)
{
nonE<-matrix(0, NnonE, 2)
ans<-.C("Y_to_nonE", NAOK=TRUE, N=as.integer(N), directed=as.integer(directed),
ans<-.C(C_Y_to_nonE, NAOK=TRUE, N=as.integer(N), directed=as.integer(directed),
Y=as.numeric(t(Y)), nonE=as.integer(t(nonE)))
return(t(matrix(ans$nonE,2)))
}
Y_to_M<-function(N, NM, directed, Y)
{
M<-matrix(0, NM, 2)
ans<-.C("Y_to_M", NAOK=TRUE, N=as.integer(N), directed=as.integer(directed),
ans<-.C(C_Y_to_M, NAOK=TRUE, N=as.integer(N), directed=as.integer(directed),
Y=as.numeric(t(Y)), M=as.integer(t(M)))
return(t(matrix(ans$M,2)))
}
E_to_Y<-function(N, NE, directed, E)
{
Y<-matrix(0,N,N)
ans<-.C("E_to_Y", NAOK=TRUE, N=as.integer(N), NE=as.integer(NE),
ans<-.C(C_E_to_Y, NAOK=TRUE, N=as.integer(N), NE=as.integer(NE),
directed=as.integer(directed), E=as.integer(t(E)), Y=as.numeric(t(Y)))
return(matrix(ans$Y,N))
}
Expand Down
2 changes: 1 addition & 1 deletion R/fruchterman_reingold.R
Expand Up @@ -5,7 +5,7 @@ fruchterman_reingold<-function(net, D=2, steps=1000, repulserad=N^D, m=N*(D-1),
Y<-as.sociomatrix(net)
X<-matrix(runif(N*D,-D^2,D^2),ncol=D)
# update X
out<-.C("fruchterman_reingold", NAOK=TRUE, directed=as.integer(directed), N=as.integer(N),
out<-.C(C_fruchterman_reingold, NAOK=TRUE, directed=as.integer(directed), N=as.integer(N),
D=as.integer(D), steps=as.integer(steps), Y=as.double(t(Y)), X=as.numeric(t(X)),
repulserad=as.double(repulserad), m=as.numeric(m), volume=as.numeric(volume))
X<-t(matrix(out$X,ncol=N))
Expand Down
2 changes: 1 addition & 1 deletion R/log_like_forces.R
Expand Up @@ -20,7 +20,7 @@ log_like_forces<-function(net, D, X, B, m=network.size(net), steps=1e3)
if (doB==1)
B<-optim(B, loglike, x=tmpx, y=y, method="BFGS", control=list(fnscale=-1))$par
# update X
out<-.C("log_like_forces", NAOK=TRUE, directed=as.integer(directed), N=as.integer(N),
out<-.C(C_log_like_forces, NAOK=TRUE, directed=as.integer(directed), N=as.integer(N),
D=as.integer(D), steps=as.integer(steps), Y=as.double(t(Y)), X=as.numeric(t(X)),
B=as.numeric(B), m=as.numeric(N))
out$X<-t(matrix(out$X,ncol=N))
Expand Down
26 changes: 14 additions & 12 deletions R/zzz.R
@@ -1,17 +1,19 @@
.onLoad <- function(lib,pkg) {
library.dynam("VBLPCM", pkg, lib)
}
library.dynam("VBLPCM", pkg, lib)
invisible()
}

.onAttach <- function(lib,pkg) {
packageStartupMessage("\n\n")
packageStartupMessage(paste("\n", "Variational Bayes Latent Position Cluster Model for networks.","\n"),
paste("VBLPCM", "Version", "2.4.7",
"Created on", "2014-01-29"), paste("\n Created and maintained by ", "Michael Salter-Townshend"), "\n")
packageStartupMessage('For citation information type \'citation("VBLPCM")\'\n')
packageStartupMessage('Type \'help(VBLPCM)\' to get started.\n')
packageStartupMessage('Some worked examples are given by \'example(VBLPCM)\' \n')
packageStartupMessage("\n\n")
packageStartupMessage(paste("\n", "Variational Bayes Latent Position Cluster Model for networks.","\n"),
paste("VBLPCM", "Version", "2.4.9",
"Created on", "2023-03-22"), paste("\n Created and maintained by ", "Michael Salter-Townshend"), "\n")
packageStartupMessage('For citation information type \'citation("VBLPCM")\'\n')
packageStartupMessage('Type \'help(VBLPCM)\' to get started.\n')
packageStartupMessage('Some worked examples are given by \'example(VBLPCM)\' \n')
}

.onUnload <- function(libpath){
library.dynam.unload("VBLPCM", libpath)
}
#.onUnload <- function(libpath){
# library.dynam.unload("VBLPCM", libpath)
# invisible()
#}
4 changes: 2 additions & 2 deletions inst/CITATION
@@ -1,8 +1,8 @@
citHeader("To cite package 'VBLPCM' in publications use:")

citEntry(entry="Article",
bibentry(bibtype="Article",
title = "Variational Bayesian Inference for the Latent Position Cluster Model",
author = personList(as.person("Michael Salter-Townshend"),
author = c(as.person("Michael Salter-Townshend"),
as.person("Thomas Brendan Murphy")),
year = "2013",
journal = "Computational Statistics and Data Analysis",
Expand Down
4 changes: 2 additions & 2 deletions man/VBLPCM-package.Rd
Expand Up @@ -11,8 +11,8 @@
\tabular{ll}{
Package: \tab VBLPCM\cr
Type: \tab Package\cr
Version: \tab 2.4.8\cr
Date: \tab 2021-10-06\cr
Version: \tab 2.4.9\cr
Date: \tab 2023-03-22\cr
License: \tab GPL (>=2) \cr
LazyLoad: \tab yes\cr
}
Expand Down
2 changes: 1 addition & 1 deletion src/init.c
Expand Up @@ -23,7 +23,7 @@ static const R_CMethodDef CEntries[] = {
void R_init_VBLPCM(DllInfo *dll)
{
R_registerRoutines(dll, CEntries, NULL, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
R_useDynamicSymbols(dll, TRUE);
R_forceSymbols(dll, TRUE);
}

0 comments on commit a6dcea1

Please sign in to comment.