ncsco / pinemap-dss-help

Issue tracker for PINEMAP DSS
0 stars 0 forks source link

Displaying model error #91

Closed daviswx closed 8 years ago

daviswx commented 8 years ago

Model error metrics are now being generated, and model error will probably need to be displayed in the DSS in some form. Doing this in an intuitive and not overly complicated way is our main challenge.

Since the model error will have three different maps -- a mean and ±2 std. devs -- we could show these on the three-map layout and have a separate map display option in the menu just for model error. However, @hadinon and I both feel like that won't be a useful way to view the error data or make assessments using it.

Instead, we discussed having the error data overlaid on the maps and time series to better show which locations have values within the spread of model error, which would render them less meaningful.

My idea is to have a single "Show Error" button/option on the page. When clicked, it would overlay a semi-transparent (the opacity could be changed with a slider bar) layer on each map, and locations with values within the model error would be more opaque (possibly in gray?).

The time series would have either three horizontal lines (one solid, two dashed) corresponding to the model error, or a shaded underlay (if it's possible in Highcharts) from 0 (on the Change display) or the historical average to the extent of the model error.

This approach would require additional processing time to create grids with binary values for each point -- whether it's inside or outside of the range of model error -- for every RCP and time period. However, IMO it would be a much more meaningful way to visualize the error.

In issue #88, we discussed using a similar approach of changing the shading/opacity and effectively hiding points within the model error for the seedling deployment tools.

hadinon commented 8 years ago

The following error metrics have been generated for all thresholds (32F, 28F, 25F, 20F, and 15F) within the Extreme Min Temp tool:

Reference my email for a link to the final files that are in THREDDS. I'm working on the rest of the tools now and will keep you posted.

In the meantime, Ryan mentioned wanting to see the 3-map layout of error so maybe you could mock that up first with a separate map display option in the menu just for model error (as mentioned above)?

hadinon commented 8 years ago

Those same error metrics have also been generated for summer precip, summer temp, and summer dryness index. I'll email you the links.

For the seedling deployment tool grids (aka. coldest day of the year), I have to regenerate 1,120 of the model baseline files before proceeding with the error calculations. These were deleted back in July 2015 when convection was running out of space. Anyways, that script is running and is estimated to take two hours. I'm hoping to produce the error metrics for this tool today as well but it may be Monday morning depending on how bad convection is getting beat up right now. :wink:

daviswx commented 8 years ago

Here's what the tool might look like with the model error displayed. Let me know if any of the display names or map titles should be changed before we show this to Ryan.

image

daviswx commented 8 years ago

Also, note that the color bars in the legend should be reversed. Red = higher positive values in this case.

hadinon commented 8 years ago

Noting this for completeness: the seedling deployment (aka coldest day of the year) error maps have been generated and I emailed the links.

As far as the map display options, I'm not sure if we'd have 3 different options if we decide to go this route above (3 map layout of the raw error metrics). We would probably just have one radio button that said "Model Error". If we decide to display error using the "if change < error" method, I'm not sure if we would need the 3 options either. We would probably do this second method as an overlay onto the existing 3 map layout. That said, I'm still trying to wrap my head around this displaying error concept.

As far as the map titles, I would change them to "Minimum Model Error", "Mean Model Error", and "Maximum Model Error" for the above display.

daviswx commented 8 years ago

Here's an updated version with those changes: image

If we go with the other method (which I prefer), my idea was to have a button or switch somewhere on the page to show the model error. When it's turned on, it would show the model error overlays on the maps and time series, and a slider bar on the page would control the transparency/opacity of the map overlays.

hadinon commented 8 years ago

Quick note/reminder about this: once changes are implemented, remove this bullet on the DSS Introduction --> Time Series page: "Note: Model error is not currently shown in the DSS" and add another bullet indicating that model error is shown.

hadinon commented 8 years ago

I just talked to Aaron about this (not intentionally, it just came up when we were talking about something else entirely) and wanted to document it here before I forgot! What if we set (or let users select) some sort of threshold of tolerance with regards to the error. For example, they might say, "If the projected change is 2 degrees higher than the error, that will impact my operations so I will use this to make a decision (e.g. alter management practices) so please show the values. Otherwise, don't display the grid cells because the guidance is not useful for my altering decision making process". I would envision a few different thresholds for users to choose from, e.g. 0.5 degrees, 1.0 degrees, and maybe 2.0 degrees for temperature-based tools. So, this would mean generating many more error grids (so maybe PINEMAPv2 worthy!) but is a neat idea. Overall, it would be a way to incorporate risk but would add yet another level of complexity for users to interpret.

daviswx commented 8 years ago

Preface: I know we talked about this today, but I'm adding it here so I don't forget over the weekend. :wink:

A model error display is now available for the Minimum Temperature Thresholds tool. For now, only data for RCP 4.5, the 2060-2079 time period, and the 32°F threshold is shown; those are hard-coded in since they're the only binary error files available at the moment.

Based on this display and what we've talked about in this thread and elsewhere, here are some questions or topics for discussion:

daviswx commented 8 years ago

Update to one previous point: I have changed the mask color to light gray so it's distinguishable from the background map and any white colors in the data.

hadinon commented 8 years ago

Here are my responses (some of which we've discussed in person but adding here for completeness):

daviswx commented 8 years ago

Here are the files being used on the Minimum Temperature Thresholds maps:

Projected Change Left map: 2stddev_plus_mean Middle map: mean Right map: 2stddev_minus_mean

Projected Average Left map: 2stddev_minus_mean Middle map: mean Right map: 2stddev_plus_mean

Model Error (currently) Right map: 2stddev_minus_mean Middle map: mean Right map: 2stddev_plus_mean

Because of this, I think I need to flip the error overlays when they're displayed on the Projected Change maps.

daviswx commented 8 years ago

Also, I have converted my previous post into a task list so it's easier to track which questions or issues we've resolved.

hadinon commented 8 years ago

OK, so it sounds like the Projected Change error maps need to be flipped but they are OK for the Projected Average error maps. Is that possible to easily do in your code? For the Projected Average, I think we will want to use the same error maps as Projected Change but let's double check with Ryan today.

Wow, that's awesome about the task list -- great idea!!

hadinon commented 8 years ago

One liner: "For areas masked in light gray, historical model error exceeds likely future changes and may not be meaningful for some decisions."

hadinon commented 8 years ago
daviswx commented 8 years ago

I have fixed the error layers so they show on the correct side maps in the Min Temp Thresholds tool, updated the wording in the legend, and disabled the Model Error option on the Historical map. I also checked those items off the task list above.

I am currently working on getting the model error data from OPeNDAP calls and adding the lines to the time series. I do want to clear up something about this, though, and make sure I'm using the correct files.

For the raw model error values (not the binary flags), I am using these three files on convection:

Lowest Likely Change/-2 standard deviations:

pinemap/maca/extreme_mintemp/annual[THRESHOLD]error/error_final_bias_1986_2005/Avg_2stddev_minus_mean_bias_METDATA_obs_minus_MACA_baseline.nc

Multi-Model Mean:

pinemap/maca/extreme_mintemp/annual[THRESHOLD]error/error_final_bias_1986_2005/Avg_mean_bias_METDATA_obs_minus_MACA_baseline.nc

Highest Likely Change/+2 standard deviations:

pinemap/maca/extreme_mintemp/annual[THRESHOLD]error/error_final_bias_1986_2005/Avg_2stddev_plus_mean_bias_METDATA_obs_minus_MACA_baseline.nc

These files give values generally centered around zero, which is exactly what we need for the Projected Change time series. For the Projected Average time series, should I just add on the historical observed value to each?

For example, in the point I'm looking at in northern Georgia (34.1041°N, 84.1941°W), I get these values: Historical Observed: 61.5 days Model Error (-2 std. dev.): -8.9 days Model Error (mean): -2.4 days Model Error (+2 std. dev.): +4.0 days

So for the Projected Average time series, should the horizontal lines appear at 52.6 days (61.5 - 8.9), 59.1 days (61.5 - 2.4), and 65.5 days (61.5 + 4.0)? Or is it more complicated than this?

Also, should we show all three model error lines on the time series, or just the highest and lowest? I can't remember whether we've talked about this previously.

daviswx commented 8 years ago

Also, one more thought about the model error display on the time series. In Highcharts, along with doing lines across the plot, you can do full bands across the plot, like in this example (our's would obviously be horizontal, not vertical).

Here's a basic example of what it might look like in our time series: image

The background color would probably need to be changed so it doesn't interfere with the bar color as much, but that gives a rough idea of a possible way to display model error. Personally, I like that better than the lines since people may not "read between the lines" and know what the space between them means.

hadinon commented 8 years ago

Yes, that is the correct approach for the Projected Average time series.

Showing the lowest and highest model error lines as full bands would be good.

Let me know if I missed any of your questions!

daviswx commented 8 years ago

Just to recap the latest developments, the error is being shown as a colored bar across the time series, so that's checked off of the to-do list above. However, there is a discrepancy between these values and the regions masked on the map since one uses the raw error data and the other uses the magnitude of the error.

Let's talk to Adrienne soon to see which method is best, and we can adjust the time series and/or map layer calculations accordingly.

Also, I still need to display the new marker text when the selected location is within the model error.

hadinon commented 8 years ago

OK, I had a lengthy conversation with Adrienne about this. In summary, I plan to recalculate the error as mean absolute error instead of mean bias. When generating the error mask / binary file, I will compare the mean absolute error with the mean absolute future difference/change.

I'll work on generating the new grids tomorrow. Let me know if you have any questions or would like to discuss more details in person.

daviswx commented 8 years ago

It's been a while since I had a statistics refresher, so off-hand, I'm not really clear about the difference between mean absolute error and mean bias. But I trust that you and Adrienne know what you're talking about!

I do have a bit of a concern about masking data in the time series, though. In my opinion, it's actually useful in that context to see exactly how the projections compare to the error.

For example, if the model error for number of days below freezing is from 50 to 60 degrees, it means one thing if the projected values run from 44 to 51 degrees -- barely within the model error -- and something completely different if the projected values run from 52 to 59 degrees -- fully within the error. It sounds like you'd want to treat these both the same way, and just remove the bars and stamp the error message in its place.

Also, having the error band across the entire time series can essentially function as a mask (with changeable transparency to boot) without having to hide entire bars altogether. One thing I might try to change is moving the error band in front of the bars, so when it's fully opaque, it does indeed hide the bars behind it.

I'm willing to listen if there is a compelling reason for removing the bars entirely if even part of them is within the model error bounds, but at this point, I think that's actually removing important information.

hadinon commented 8 years ago

I want to try to document all these error conversations in a summarized way so here are some notes:

Other notes:

Action item:

Please reply with anything that I may have missed!

daviswx commented 8 years ago

This summarizes my understanding of our discussion as well.

Re: your concern in the final part, I think this will be fine on the Minimum Temperature Thresholds tool, but I'm not quite sure about the Summer Precipitation tool, which can have Projected Change values on either side of 0. Luckily, we don't have to worry about that quite yet.

On the DSS, I will remove the ±2 std. dev. error files and instead bound the time series error band with the mean value on either side of 0. I may also add dashed lines at the top and bottom like on our sketches.

hadinon commented 8 years ago

Posting an update here for good measure: the binary flag file has been regenerated using mean absolute error and comparing that with the absolute value of the mean projected change values for RCP4.5 2060-2079 on the Minimum Temperature Threshold 32F. This binary file will now be used for the error mask on the center map of the DSS. Binary flags have also been generated for the side maps by comparing the mean absolute error with the absolute value of the mean+/-2stddev project changes.

I'm working on generating these same type of binary files for other RCP and time slices for 32F threshold.

Also, for the time series, the raw mean absolute error file has been generated (same name as previous mean bias error file).

daviswx commented 8 years ago

I have checked off the final two to-do boxes above.

When the model error is enabled and a clicked location has a value less than the magnitude of the model error, a message displays (in red) above the map marker stating "Error Exceeds Projection".

image

Also, I added the preliminary Q&A about model error to the FAQ box, although we still need to write a part about the error band on the time series.

Once the binary files for the other RCPs, time periods, and thresholds are ready, I can comment out the hard-coded RCP 4.5 and 2060-2069 period so the page will dynamically update the error overlays.

daviswx commented 8 years ago

Based on feedback and discussions at the annual meeting, here are some suggested action items related to the model error:

Also, I found a couple small bugs with the current implementation of model error:

Both of these bugs may not be problems if we decide to show the model error at all times, but I'd like to fix them before we move to that step.

hadinon commented 8 years ago

I was able to replicate the bug related to the location box flashing in green by using Firefox but not in Chrome.

daviswx commented 8 years ago

The multiple flashes bug with the location box in Firefox seems to be fixed. My call to a function that updates the location was embedded in a loop, so it was getting triggered 3 or 4 times instead of just once.

After moving this out of the loop, it also fixed the second bug mentioned above with the marker labels not updating when the model error is turned off.

daviswx commented 8 years ago

I have made some progress on the action items listed above:

image

We still have a few action items related to model error/limitations:

And maybe some other things that I'm forgetting?

daviswx commented 8 years ago

The collective SCO group has suggested changing the map marker wording again since "Within model limitations" may be conceived as a good thing. Off-hand, I don't have any different ideas. Ryan suggested "Exceeds model capabilities", but I also wonder if users might interpret that as a good thing since it includes the word "exceeds".

hadinon commented 8 years ago

Ryan suggests: "Exceeds model capability" and "Outside margin of error". Feedback from the PINEMAP meeting suggested avoiding the use of "error" so maybe the latter is out. I just noticed your comment about "exceeds" possibly being interpreted as a good thing. Perhaps "Outside model capability"? Or, "low confidence"?

hadinon commented 8 years ago

Also, my only suggestion about the most recent changes is that the orange "Model limitations" text on the time series is sometimes hard to read depending on the background colors of the graph. Perhaps try white text or add an outline around the orange text like this?

image

hadinon commented 8 years ago

I asked Kieran if she had any ideas. Here's what she came up with (using a rule of 5 words or less):

Or, since people will be basing decisions off of these models, you could call these areas a region of:

Also, "Unable to predict with current model" is very straightforward, but too long :(

daviswx commented 8 years ago

I had the same thought about the "Model limitations" label being tough to read. However, Highcharts styling doesn't support a text border like you suggested, and using a drop shadow isn't much easier to read and also apparently isn't supported well in IE.

I did just darken up that text color so hopefully it will stand out a bit more:

image

I don't necessarily have any ideas about the marker wording, but in my opinion, any of the ones that include terms like "exceeds", "beyond", and even "capabilities" are likely to be misinterpreted because those are all positive terms.

hadinon commented 8 years ago

Thanks for the update about the model limitations label.

At our meeting today, did we get consensus on which terminology to use for the marker? We've already asked Aim 6 for guidance. Does anyone else come to mind that might be able to provide assistance with this? Maybe Tim?

daviswx commented 8 years ago

Ryan suggested saying something like "Outside margin of error". Although that still has the potential problem of using the word "error", I think it's one of the better ideas we've come up with so far.

The Aim6 folks, particularly Gary, Eric, and Leslie, were fairly helpful with crafting this sort of language at the annual meeting, so maybe they would be good ones to consult with. I'd suggest that we might want to come up with a few additional possible wordings to run by them, and also allow them to suggest their own.

daviswx commented 8 years ago

When the model error is displayed in the time series, note in the tooltips when mousing over the bars whether values are within the range of model error. For consistency's sake, use the same wording as whatever we decide for the map marker labels ("outside margin of error"?).

daviswx commented 8 years ago

Here are the wording options we'd like to run by Aim6:

Outside margin of error Within model limitations Exceeds model capabilities Data not applicable Model not applicable Error exceeds projection Limited model skill Other: ___

hadinon commented 8 years ago

A Google Form (to be sent to Aim 6 soon) has been created with those wording options and another question about the respondent's role on the project, e.g., co-PI, staff, student. I thought it might be neat to stratify responses by role.

daviswx commented 8 years ago

For now, I have changed these labels to read "Error exceeds projection". Once we get the feedback from Aim 6 et al., this can be updated to reflect the consensus suggestion.

daviswx commented 8 years ago

Just to summarize the feedback we received, the PINEMAP respondents were split in their preferences, but three answers received the most support: "Error exceeds projection", "Limited model skill", and the volunteered response of "Low/limited model confidence". Direct feedback from Aim 6 suggested that they also preferred "Data not applicable".

After further discussions with Aim 6, we decided that each of these had drawbacks, so we instead went with a slightly longer option, but one that more closely reflected what we already had in the legend: "This location's value is not meaningful".

The new wording has been implemented on the PINEMAP DSS and Climate Voyager development sites and will be pushed to the public-facing sites in the next updates.

I have also been drafting some ideas for the model limitations tooltip. It's tough because there is limited room to work with (I'm trying to limit it to 3 or 4 lines) an a lot to explain! Of course, we do have the FAQ to link to at the bottom of the tooltip. Here are a few possible options I have come up with:

Let me know if you have any other ideas for how to word this.

hadinon commented 8 years ago

The second one seems like a good balance. I've added one additional word in there! Thoughts?

"By comparing model performance to historical observations over a time period in the recent past, we can see how well the models performed at each location. In areas with poor historical performance, we lack confidence in the future projections."

daviswx commented 8 years ago

I made one more small wording change before adding this to the DSS and Climate Voyager:

"By comparing historical observations with model performance over a time period in the recent past, we can see how well the models captured those past conditions each location. In areas with poor historical performance, we lack confidence in the future projections."

That has been implemented so I will close this issue for now. We may need to re-open it once other error grids are ready.

hadinon commented 8 years ago

I'm not going to re-open because this is minor -- should it be "...those past conditions at each location"?

hadinon commented 8 years ago

I was looking through the above comments and there are a few outstanding items:

a) We discussed adding a tooltip about model limitations for the time series legend. I'm thinking the same text as the map tooltip could be used. Thoughts?

b) From above: "When the model error is displayed in the time series, note in the tooltips when mousing over the bars whether values are within the range of model error. For consistency's sake, use the same wording as whatever we decide for the map marker labels."

c) Generate the binary overlay for all other tools.

I'm still working on c).

daviswx commented 8 years ago

I have added that missing word in the map legend tooltip and added a model limitations tooltip in the time series legend. The text isn't exactly the same since I wanted the time series one to specifically mention the meaning of the range and values that fall within it.

I can definitely add a note in the time series tooltips to indicate when values are within the range of model limitations. Do you have an idea for what this should look like? Here's a mockup that uses the same wording as in the map legend:

timeseries_tooltip_limitations

hadinon commented 8 years ago

Sounds good. I like the text that you used for the time series legend tooltip and the mockup looks good, too.

daviswx commented 8 years ago

The new time series tooltip text has been implemented on both the DSS and Climate Voyager development sites.