Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vincent Issue: quant_vals not found #9

Open
posadac opened this issue Jul 11, 2024 · 0 comments
Open

Vincent Issue: quant_vals not found #9

posadac opened this issue Jul 11, 2024 · 0 comments

Comments

@posadac
Copy link

posadac commented Jul 11, 2024

When calculating vincent ensembles, if the projection ever reports the same value for all quantiles in a specific grouping, the vincent function throws the error "'quant_vals' not found."

In the files attached, there is one subset that triggers this error in vincent (several of the groupings report 1 unique value for all quantiles) and another subset that does not trigger the error (all groups report more than 1 unique value for all quantiles).

Using this file to illustrate the issue:
ExcelVincente_issue_example.xlsx

And using the subsequent code:
`data <- read_excel("Vincente_issue_example.xlsx")

####version of quant_old that does not work in Vincente function
quant_old_bad<-quant_old_example %>%filter(model=="A" | model=="B")

###in quant_old_bad, there are instances where all the quantiles for one location, model, age_group report the same value. In quant_old_bad_unique this is represented when the last column has a value=1
quant_old_bad_unique<-quant_old_bad%>%group_by(model, location_name.x,age_group, population.y, scenario_id, value_r)%>%summarise(unique.value=length(unique(quantile.value)))

vincent function not working. throwing error:"quant_vals not found"

vincent_not_working=aggregate_cdfs(data=quant_old_bad %>% dplyr::rename(value=quantile.value),
id_var = "model",
group_by = c("location_name.x", "age_group", "population.y",
"scenario_id","value_r"),
method = "vincent",
ret_quantiles = quantile.vec)

####Following subset does work in vincente function:
####version of quant_old that does not work:
quant_old_good<-quant_old_example%>%filter(age_group=="0-130" &(model=="C" | model=="B"))

###in quant_old_good, there is high variability in quantiles
quant_old_good_unique<-quant_old_good%>%group_by(model, location_name.x,age_group, population.y, scenario_id, value_r)%>%summarise(unique.value=length(unique(quantile.value)))

vincent function works here

vincent_working=aggregate_cdfs(data=quant_old_good %>% dplyr::rename(value=quantile.value),
id_var = "model",
group_by = c("location_name.x", "age_group", "population.y",
"scenario_id","value_r"),
method = "vincent",
ret_quantiles = quantile.vec)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant