Skip to content

Commit

Permalink
upgraded docs syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
AsafManela committed Feb 17, 2019
1 parent 6e3d282 commit 56ceab6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,25 @@ pkg> add HurdleDMR

Add parallel workers and make package available to workers
```julia
addprocs(Sys.CPU_CORES-2)
using Distributed
addprocs(Sys.CPU_THREADS-2)
import HurdleDMR; @everywhere using HurdleDMR
```

Setup your data into an n-by-p covars matrix, and a (sparse) n-by-d counts matrix.
Here we generate some random data.
```julia
using CSV, GLM, DataFrames, Distributions
using CSV, GLM, DataFrames, Distributions, Random, LinearAlgebra, SparseArrays
n = 100
p = 3
d = 4

srand(13)
m = 1+rand(Poisson(5),n)
Random.seed!(13)
m = 1 .+ rand(Poisson(5),n)
covars = rand(n,p)
ηfn(vi) = exp.([0 + i*sum(vi) for i=1:d])
q = [ηfn(covars[i,:]) for i=1:n]
scale!.(q,ones(n)./sum.(q))
rmul!.(q,ones(n)./sum.(q))
counts = convert(SparseMatrixCSC{Float64,Int},hcat(broadcast((qi,mi)->rand(Multinomial(mi, qi)),q,m)...)')
covarsdf = DataFrame(covars,[:vy, :v1, :v2])
```
Expand Down

0 comments on commit 56ceab6

Please sign in to comment.