You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sampling the mode shares for PM and CO2 emissions uses a Gamma function which creates Dirichlet distributed parameters. This Gamma function does not work properly for small mode shares and low confidence in the mode shares.
In ithim_setup_parameters.R (line 149 for PM and CO2 starts after PM)
Sampling the mode shares for PM and CO2 emissions uses a Gamma function which creates Dirichlet distributed parameters. This Gamma function does not work properly for small mode shares and low confidence in the mode shares.
In ithim_setup_parameters.R (line 149 for PM and CO2 starts after PM)
if(PM_EMISSION_INVENTORY_CONFIDENCE<1){
total <- sum(unlist(PM_EMISSION_INVENTORY))
parameters$PM_EMISSION_INVENTORY <- list()
for(n in 1:NSAMPLES){
samples <- lapply(PM_EMISSION_INVENTORY,function(x) rgamma(1,shape=x/total*dirichlet_pointiness(PM_EMISSION_INVENTORY_CONFIDENCE),scale=1))
new_total <- sum(unlist(samples))
parameters$PM_EMISSION_INVENTORY[[n]] <- lapply(samples,function(x)x/new_total)
}
}
Gamma function needs updating.
The text was updated successfully, but these errors were encountered: