PageRenderTime 25ms CodeModel.GetById 22ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/working/auteur/R/adjustrate.R

http://github.com/eastman/auteur
R | 13 lines | 8 code | 2 blank | 3 comment | 0 complexity | 2920cede7f763b632ab8c684fd1d0ec2 MD5 | raw file
 1#rjmcmc proposal mechanism: scale a rate (limited to only positive values) given a proposal width ('jumpsize')
 2#author: JM EASTMAN 2010
 3
 4adjustrate <-
 5function(rate, jumpsize) {
 6# mod 10.20.2010 JM Eastman
 7	vv=rate
 8	v=log(vv)
 9	rch <- runif(1, min = -jumpsize, max = jumpsize)
10	v=exp(v[]+rch)
11	v
12}
13