Skip to content

Commit

Permalink
version 2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Salter-Townshend authored and cran-robot committed Mar 7, 2014
1 parent fec402a commit 896fac7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
2014/01 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
2013/10 checked for leaks using AddressSanitizer, moved some Depends to Imports
2013/05 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.
Expand Down
10 changes: 6 additions & 4 deletions DESCRIPTION
@@ -1,18 +1,20 @@
Package: VBLPCM
Type: Package
Title: Variational Bayes Latent Position Cluster Model for networks.
Version: 2.4.2
Date: 2013-10-31
Version: 2.4.3
Date: 2014-03-07
Author: Michael Salter-Townshend
Maintainer: Michael Salter-Townshend <mike.saltertownshend@gmail.com>
Description: A package to fit and simulate latent position and cluster
models for statistical networks using a Variational Bayes approximation.
Depends: ergm, sna
Imports: mclust
SystemRequirements: Gnu Scientific Library version >= 1.12
URL: http://www.r-project.org,
https://sites.google.com/site/mikesaltertownshend/software/
License: GPL (>= 2)
LazyLoad: yes
Packaged: 2013-10-31 11:45:59 UTC; mst
Packaged: 2014-03-07 15:13:08 UTC; salter
NeedsCompilation: yes
Repository: CRAN
Date/Publication: 2013-10-31 14:00:51
Date/Publication: 2014-03-07 16:31:03
14 changes: 7 additions & 7 deletions MD5
@@ -1,5 +1,5 @@
7b700f1100f4f02975440441b77fc806 *CHANGELOG
b77f654729f3b2c6e438b2b07580c9dd *DESCRIPTION
47c4ad357b789a41e51e3d1b0c1e0e75 *CHANGELOG
c405b14618ed92c0c3d53a3530a3cee7 *DESCRIPTION
c771c3b32ace90453b25137ffb8b2230 *NAMESPACE
93ddbebf082e5c5a3d09d70b0ba310af *R/KL.R
85b49f0298acd5832328bf7056a7d89a *R/VBLPCM.R
Expand All @@ -12,11 +12,11 @@ c771c3b32ace90453b25137ffb8b2230 *NAMESPACE
6d0b56049f54c59dbe71754983a9a80d *R/predict.R
203861162888e86a84e9b20d62f2d8ba *R/print.vblpcm.R
32ef7505c44b2245b165b30aa1ebf816 *R/roc.R
cbc3892e84de2ad70d53419d1f5b66e2 *R/start.R
74999cc02889948d93e218447e9882d0 *R/start.R
4f69c86b26fbc64b90e83eb39a6ac450 *R/summarise_groups.R
054e8f388ac9c8373ab5b6e66818754e *R/summary.vblpcm.R
31c8ccdf29df94b0f5f9508fcb1a7e9e *R/vb_bic.R
63614bbf06782761aa98e6a8896385ef *R/zzz.R
254ef73e0dbf2d89e737a0b51310b828 *R/zzz.R
1215b49b49d2dcb0f996500bd0e7c5ce *configure
654b38e8f3726e7c9613425a5b50bbd8 *configure.ac
013778ff539b989141783da07f3ddd03 *data/aids.rda
Expand All @@ -25,7 +25,7 @@ cbc3892e84de2ad70d53419d1f5b66e2 *R/start.R
9beed6138652a9e4ebedd2cb1f270acb *inst/CITATION
4ccabdb12a6c7592d26cceab34755ee0 *man/E_to_Y.Rd
62b220ff6a4b95449f21d7eabbbd5848 *man/VBLPCM-internal.Rd
8d1dca5c8575cf5ebd1fa4bb26a50c8d *man/VBLPCM-package.Rd
fc35fed5ec4639c8185242377165c745 *man/VBLPCM-package.Rd
1d21ac5b8c3d8909d4782465e94cec14 *man/Y_to_E.Rd
0eb794fe9b2faea92c95f0146560ac1a *man/Y_to_M.Rd
a3d9e7566f96741ba738afda6cade6d7 *man/Y_to_nonE.Rd
Expand All @@ -48,10 +48,10 @@ faf7bff0082bb61e117b9d83441fcd3a *man/vblpcmfit.Rd
0168242a2c896382b916a70d449451e6 *man/vblpcmgroups.Rd
5c4be52f6272def826fa69501171c448 *man/vblpcmroc.Rd
6b4b558ac60b6a284b02bd5295fb6ee9 *man/vblpcmstart.Rd
acaeca43833c3432693fe5f9a6149bf9 *src/KL_funcs.c
b590337ea2d7b3537ddf0f0af08451fb *src/KL_funcs.c
0cacb14c872b3c9d87e81ab3bb4ce9b5 *src/Makevars.in
db26274171b9a08ecd0cc28116f5a6f5 *src/Makevars.win
6de979e4a8336b9dd9a29b760ae19c2d *src/VBLPCM.c
a62a6fd799c80e8645aa4c8a759a8edf *src/VBLPCM.c
f817a5918c432421b21e0be0475d4861 *src/adjacency_to_edges.c
0ce87e3ee8377add5fec4f42df2bb544 *src/bb.c
61a39c5900a8b02859418ac8e209e974 *src/fruchterman_reingold.c
Expand Down
2 changes: 2 additions & 0 deletions R/start.R
Expand Up @@ -69,6 +69,8 @@ vblpcmstart<-function(g.network, G=1, d=2, LSTEPS=5e3, model="plain", CLUST=0, B
receivecovs<-as.matrix(receivecovs[tmp,])
if (!is.null(socialcovs))
socialcovs<-as.matrix(socialcovs[tmp,])
if (!is.null(edgecovs))
edgecovs<-c(matrix(edgecovs,N)[tmp,tmp])
g.network<-network(as.sociomatrix(all_g.network)[(1:N)[tmp],(1:N)[tmp]],directed=is.directed(all_g.network))
for (att in list.vertex.attributes(all_g.network))
set.vertex.attribute(g.network,att,get.vertex.attribute(all_g.network,att)[tmp])
Expand Down
4 changes: 2 additions & 2 deletions R/zzz.R
Expand Up @@ -5,8 +5,8 @@
.onAttach <- function(lib,pkg) {
packageStartupMessage("\n\n")
packageStartupMessage(paste("\n", "Variational Bayes Latent Position Cluster Model for networks.","\n"),
paste("VBLPCM", "Version", "2.4.2",
"Created on", "2013-05-22"), paste("\n Created and maintained by ", "Michael Salter-Townshend"), "\n")
paste("VBLPCM", "Version", "2.4.3",
"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')
Expand Down
Empty file modified data/aids.rda 100755 → 100644
Empty file.
Empty file modified data/sampson.rda 100755 → 100644
Empty file.
Empty file modified data/simulated.network.rda 100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions man/VBLPCM-package.Rd
Expand Up @@ -11,8 +11,8 @@ Variational Bayes approximation to the posterior for the Latent Position Cluster
\tabular{ll}{
Package: \tab VBLPCM\cr
Type: \tab Package\cr
Version: \tab 2.4.2\cr
Date: \tab 2013-10-31\cr
Version: \tab 2.4.3\cr
Date: \tab 2014-03-07\cr
License: \tab GPL (>=2) \cr
LazyLoad: \tab yes\cr
}
Expand Down
4 changes: 2 additions & 2 deletions src/KL_funcs.c
Expand Up @@ -534,8 +534,8 @@ void gr_KL_V_alpha_g (const gsl_vector *v_V_alpha_g, void *null, gsl_vector *df)
(*params->D* *params->inv_sigma02* gsl_sf_psi_1(0.5* *params->inv_sigma02*V_alpha_g)-
0.5* *params->inv_sigma02*(params->V_sigma2[i]+params->V_omega2[g]+tmp));
}
KL = tmpsum + (0.5*(V_alpha_g-params->alpha[*params->g])* gsl_sf_psi_1(0.5*V_alpha_g) -
gsl_sf_psi(0.5*V_alpha_g)) + gsl_sf_psi(0.5*V_alpha_g)/lgamma(0.5*V_alpha_g);
KL = tmpsum + (0.5*(V_alpha_g-params->alpha[*params->g])* gsl_sf_psi_1(0.5*V_alpha_g));// -
//gsl_sf_psi(0.5*V_alpha_g)) + gsl_sf_psi(0.5*V_alpha_g)/lgamma(0.5*V_alpha_g);
gsl_vector_set(df, 0, -KL);
return;
}
Expand Down
5 changes: 3 additions & 2 deletions src/VBLPCM.c
Expand Up @@ -242,7 +242,8 @@ for (l=0; l<*steps; l++) // number of cycles through the variational algorithm
//tmp = GSQRT (tmp+*D*(V_sigma2[samp_nodes[i]]+V_omega2[samp_groups[g]]));
tmp = GSQRT (tmp+(V_sigma2[samp_nodes[i]]+V_omega2[samp_groups[g]]));
V_lambda[samp_groups[g]* *N + samp_nodes[i]] =
exp(-1.0-0.5* *inv_sigma02*V_alpha[samp_groups[g]]*(tmp)+
//exp(-1.0-0.5* *inv_sigma02*V_alpha[samp_groups[g]]*(tmp)+
exp(-1.0+gsl_sf_psi(0.5* *inv_sigma02*V_alpha[samp_groups[g]])-0.5* *inv_sigma02*V_alpha[samp_groups[g]]*(tmp)+
gsl_sf_psi(V_nu[samp_groups[g]]) - gsl_sf_psi(tmpsum1));
}
tmp = 0.0;
Expand All @@ -264,7 +265,7 @@ for (l=0; l<*steps; l++) // number of cycles through the variational algorithm
{
tmp = 0.0;
for (i=0; i<*N; i++)
tmp += V_lambda[samp_groups[g]* *N + i]* *inv_sigma02*V_alpha[samp_groups[g]];
tmp += V_lambda[samp_groups[g]* *N + i]* V_alpha[samp_groups[g]]; // removed inv_sigma02 31/01/2014
tmp = tmp/(*D/ *inv_sigma02) + 1.0/ *omega2;
V_omega2[samp_groups[g]] = 1.0/tmp;
}
Expand Down

0 comments on commit 896fac7

Please sign in to comment.