Skip to content

Instantly share code, notes, and snippets.

@jonrobinson2
Last active March 22, 2017 18:26
Show Gist options
  • Save jonrobinson2/fae8d4748973c7e89e880c8eca983ca5 to your computer and use it in GitHub Desktop.
Save jonrobinson2/fae8d4748973c7e89e880c8eca983ca5 to your computer and use it in GitHub Desktop.
require(arm)
set.seed(987654321)
.tmp=(rnorm(100000, mean=0))
.tmp=invlogit(.tmp)
shift_param=.3
par(mfrow=c(1,3))
hist(x=.tmp, main=paste0('Mean=',round(mean(.tmp),3)))
hist(x=invlogit(logit(.tmp) + shift_param),main=paste0('Mean=',round(mean(invlogit(logit(.tmp) + shift_param)),3)))
plot(.tmp,invlogit(logit(.tmp) + shift_param))
abline(0,1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment