This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Showing /Users/thomasvladeck/Git/bh_pro/app/views/proposals/_cover_sheet.xlsx.axlsx where line #6 raised: | |
No such file or directory - /uploads/account/logo/1/me_climbing_mountains.jpg | |
Extracted source (around line #6): | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):012:0> account.logo.url | |
=> "/uploads/account/logo/1/me_climbing_mountains.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- method: energy_cost_savings | |
display: Energy Cost Savings | |
tip: This is the tooltip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tooltips.keys.each do |key| | |
define_method(key) { tooltip tooltips[key][:display], t[key][:tip] } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydata <- d | |
wss <- (nrow(mydata)-1)*sum(apply(mydata,2,var)) | |
for (i in 2:15) wss[i] <- sum(kmeans(mydata, | |
centers=i)$withinss) | |
plot(1:15, wss, type="b", xlab="Number of Clusters", | |
ylab="Within groups sum of squares") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NBD with t distributed beta | |
beta.nbd.density <- function(x, r, alpha, a, b) | |
{ | |
# params: | |
# x: count we are evaluating density at | |
# r: nbd r parameter | |
# alpha: nbd alpha parameter | |
# a: beta alpha parameter | |
# b: beta beta parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beta.nbd.ll <- function(x, n_x, r, alpha, a, b) | |
{ | |
# params: | |
# x: vector of counts | |
# n_x: number of observations for each count | |
# r, alpha: nbd params | |
# a, b: beta params | |
# output: | |
# the log-likelihood of the model | |
probs <- sapply(x, function(y) beta.nbd.density(y, r, alpha, a, b)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Betas # | |
samples <- coda.samples(jags, c('beta_age', | |
'beta_percent_white', | |
'beta_uninsured', | |
'beta_unemployed', | |
'beta_percent_degree', | |
'beta_income', | |
'beta_health'), 10000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model { | |
for(i in 1:n_obs){ | |
hrc_votes[i] ~ dbin(p[i], n_votes[i]) | |
p[i] ~ dbeta(alpha[i], beta[i]) | |
# reparameterization of the beta distribution taken from this site | |
# http://bit.ly/2i880Oj | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexation <- function(A) | |
{ | |
A / ((rowSums(A)/sum(rowSums(A))) %*% | |
t(colSums(A)/sum(colSums(A))) * | |
sum(A)) | |
} |