update sample means demo
This commit is contained in:
parent
1e1560974e
commit
7c05303cda
@ -2,7 +2,7 @@ if ( !is.loaded("mpi_initialize") ){
|
|||||||
library(Rmpi)
|
library(Rmpi)
|
||||||
}
|
}
|
||||||
|
|
||||||
number_of_plots = 5
|
number_of_plots = 10
|
||||||
nodes = mpi.universe.size()-1
|
nodes = mpi.universe.size()-1
|
||||||
mpi.spawn.Rslaves(nslaves=nodes)
|
mpi.spawn.Rslaves(nslaves=nodes)
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ generate_plot <- function(filename){
|
|||||||
samples = rep(NA, 100000)
|
samples = rep(NA, 100000)
|
||||||
for ( i in 1:100000 ){ samples[i] = mean(rexp(40, 0.2)) }
|
for ( i in 1:100000 ){ samples[i] = mean(rexp(40, 0.2)) }
|
||||||
|
|
||||||
jpeg(paste('plots/', filename, '.jpg', sep=""))
|
jpeg(paste('plots/plot', filename, '.jpg', sep=""))
|
||||||
|
|
||||||
hist(samples, main="", prob=T)
|
hist(samples, main="", prob=T)
|
||||||
lines(density(samples), col="darkblue", lwd=3)
|
lines(density(samples), col="darkblue", lwd=3)
|
||||||
|
Loading…
Reference in New Issue
Block a user