Git Product home page Git Product logo

ebnmf's Introduction

Installation

You can install the development version of ebnmf like so:

devtools::install_github('DongyueXie/ebnmf')

Example

library(ebnmf)
set.seed(123)
n = 120
p = 300
K= 3
L = matrix(0, nrow=n, ncol=K)
FF = matrix(0, nrow=K, ncol=p)
L[1:(n/3),1] = 1
L[((n/3)+1):(2*n/3),2] = 1
L[((2*n/3)+1):n,3] = 1
L = L + matrix(runif(n*K,0,0.5),nrow=n)
FF[1,1:(p/3)] = 1+10
FF[2,((p/3)+1):(2*p/3)] = 1+10
FF[3,((2*p/3)+1):p] = 1+10
lambda = L %*% FF
sigma2=0.0
lambda_noised = lambda*exp(matrix(rnorm(n*p,0,sqrt(sigma2)),nrow=n))
X = matrix(rpois(n=length(lambda_noised),lambda_noised),nrow=n)

res= ebnmf(X,K,ebpm.fn = c(ebpm::ebpm_gamma,smashrgen::ebpm_pois_sgp),smooth_F = T,tol=1e-5,maxiter = 100,warm_start = T,
           smooth_control = list(maxiter=3))

plot(res$EF[,1],type='l')
plot(res$EF[,2],type='l')
plot(res$EF[,3],type='l')

plot(res$EL[,1])
plot(res$EL[,2])
plot(res$EL[,3])

ebnmf's People

Contributors

dongyuexie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.