-
Notifications
You must be signed in to change notification settings - Fork 11
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
1. Adds map plot of model output to priors app #147
Conversation
…ons, updating vignette to cover new map tab
…, need to check this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few changes that need to be made.
- In my opinion, only the plot of “mean_post + fixed_mean” and the plot of “mean_post” hold statistical significance.
-
The plot of “mean_post + fixed_mean” means we are plotting the predicted mean fields on the raw data scale. It corresponds to the code:
z <- base::exp(base::as.numeric(A_proj %*% var_a[1:mesh$n]) + base::sum(var_b))
-
The plot of “mean_post ” means we are plotting the random effect fields. It corresponds to the code:
z <- var_a[1:mesh$n]
After computing “z” properly, we can then plot using create_raster()
- It would be helpful to provide explanations for the variables "mean_post" and "fixed_mean" respectively, maybe under the "Help" tab:
-
“mean_post” represents the random effect values at mesh nodes
-
“fixed_mean” denotes the fixed effects values, i.e., the regression parameters values
- Depending on the data type, the calculation of z is a bit different. If plotting “mean_post + fixed_mean”, then it should be
z <- base::exp(base::as.numeric(A_proj %*% var_a[1:mesh$n]) + base::sum(var_b))
for Poisson data.
z <- base::as.numeric(A_proj %*% var_a[1:mesh$n]) + base::sum(var_b)
for Gaussian data
If plotting “mean_post”, it should bez <- var_a[1:mesh$n]
for both Poisson and Gaussian data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great, thank you @gareth-j. Is it possible to add a legend to the outputs map? Currently, the raster image doesn't have a legend, so we can't know which colors represent high values, which represents low values. Function leaflet::addLegend(pal = , values =, title = " ")
should help with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The legend looks good, thanks.
Summary of changes
Adds ability to plot predictions data onto a
leaflet
map.Please check if the PR fulfills these requirements
styler
run over codeCHANGELOG.md
file if fixing a bug or adding a new featureDESCRIPTION