Skip to content

Commit

Permalink
version 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jdanielnd authored and gaborcsardi committed Aug 10, 2015
1 parent 181acc8 commit 4583826
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: slfm
Type: Package
Title: Tools for Fitting Sparse Latent Factor Model
Version: 0.2.1
Version: 0.2.2
Author: Joao Duarte and Vinicius Mayrink
Maintainer: Joao Duarte <jdanielnd@gmail.com>
Description: Set of tools to find coherent patterns in microarray data
Expand All @@ -21,6 +21,6 @@ Imports: Rcpp (>= 0.11.0), coda, lattice
LinkingTo: Rcpp, RcppArmadillo
License: GPL-2
NeedsCompilation: yes
Packaged: 2015-08-08 15:03:06 UTC; jdanielnd
Packaged: 2015-08-10 01:50:32 UTC; jdanielnd
Repository: CRAN
Date/Publication: 2015-08-08 17:41:43
Date/Publication: 2015-08-10 09:09:59
6 changes: 3 additions & 3 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
c63be246b93827f2e4574d3231acab25 *DESCRIPTION
ce2efd977e304e8f1f7c028f0511e1a9 *DESCRIPTION
87b17ef5c347ec4ca6d1641066700c30 *NAMESPACE
c16341d14e28876570e5c0f0a6b1ff87 *NEWS
41649bf0cc9c65822824ba54266a1111 *NEWS
3e11a37d28ca0244100992886a82d3d5 *R/RcppExports.R
32e909834a9fc4e509216e033d45c8f6 *R/class_interval.r
baabf72d4bc884b4c1a64efa0ab6929f *R/plot_matrix.r
87f7eeceee7273541541ba5c589103ec *R/process_matrix.r
43023f17cf4534c205f467c51594dff3 *R/slfm-package.r
ccef8b309606ef4d17db2c21c47019ea *R/slfm.r
b5d2f894bb4bd9bb537c3fdcfbd399f0 *R/slfm.r
58005212f9aba9f2f545e0f1a0630f3e *R/slfm_list.r
540f05f21a09f459cc33f9d244ac919d *man/plot_matrix.Rd
59958c4ef88f62f062a57ede17dd64c7 *man/process_matrix.Rd
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
slfm 0.2.2
===========

* changing chain indicator used in alpha estimator

slfm 0.2.1
===========

Expand Down
11 changes: 6 additions & 5 deletions R/slfm.r
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ slfm <- function(
alpha_clas <- format_classification(class_interval(hpds_q_star))
alpha_clas_mean <- class_mean(stats_q_star)

z_matrix <- coda::as.mcmc(res[["z"]][after_burnin,])
z_matrix <- window(z_matrix, thin = lag)

alpha_matrix <- coda::as.mcmc(res[["alpha"]][after_burnin,])
alpha_matrix <- window(alpha_matrix, thin = lag)

table_alpha <- alpha_estimation(res[["alpha"]][after_burnin,], alpha_clas_mean, res[["qstar"]][after_burnin,])
table_alpha <- alpha_estimation(res[["alpha"]][after_burnin,], alpha_clas_mean, res[["z"]][after_burnin,])

lambda_matrix <- coda::as.mcmc(res[["lambda"]][after_burnin,])
lambda_matrix <- window(lambda_matrix, thin = lag)
Expand All @@ -74,8 +77,6 @@ slfm <- function(
table_sigma <- cbind(stats_sigma, hpds_sigma)[,-4]
colnames(table_sigma)[4:5] = c("Upper HPD", "Lower HPD")

z_matrix <- coda::as.mcmc(res[["z"]][after_burnin,])
z_matrix <- window(z_matrix, thin = lag)

obj <- list(
x = x,
Expand Down Expand Up @@ -103,9 +104,9 @@ print.slfm <- function(x) {
print(x$classification)
}

alpha_estimation <- function(x, alpha_clas, q_star_matrix) {
alpha_estimation <- function(x, alpha_clas, z_matrix) {
table_list <- lapply(1:length(alpha_clas), function(i) {
chain_indicator <- q_star_matrix[, i] > 0.5
chain_indicator <- z_matrix[, i] == 1
if(alpha_clas[i]) {
chain <- x[chain_indicator, i]
} else {
Expand Down

0 comments on commit 4583826

Please sign in to comment.