jrckln / Bendyourspline

2 stars 0 forks source link

Optimal fit B-splines and natural splines #32

Open jrckln opened 3 years ago

jrckln commented 3 years ago

I've added a button to the FP tab which sets all coefficients sliders to the optimal fit ( d624f0a9d86abc40f219a4ee75766c6533399cf3 ). Please review the functionality etc. because implementing this in a dynamic way for splines is a huge amount of work.
Alternatively, we could just show/hide the optimal fit using a button in the plot.

AngelikaGeroldinger commented 3 years ago

Looks really nice! I prefer the version, where pressing the button modifies (some of) the input parameters and moves the black line to the "optimal fit" (as implemented for FP, if you disable the SLIDER for optimal fit, using only the button for optimal fit). In my opinion, the yellow line, which you get by activating the slider for optimal fit (currently the only version implemented for the splines tabs), is a bit confusing.

AngelikaGeroldinger commented 3 years ago

I think, we should define what we mean by optimal fit (at least to me that is not clear). I will open an additional issue.

ChristineWallisch commented 3 years ago

On the one hand, if we only show the "optimal" fit in the graph (based on the current knot positions) but the sliders are not moved, an exercise could be that users have to fit this optimal line by changing the coefficent values. On the other hand, it would also be nice if the slides are moved to the parameter values that give the "optimal" fit after pressing the button such that they directly see the estimated parameter values. But then users may lose the motivation to play with the parameters.

And I agree with Angelika, we should also think about how to define the optimal fit since it could be fixed to one optimal fit with the default number of knots and position, or it could be individually fitted with the current knot settings.

matherealize commented 3 years ago

First off, the app looks so much nicer when you open it now and the data is shown with a good fit :+1:

I think there is no strictly "better" version here. I can see use for the optimal yellow line as a guide, as Christine says: "Try to find the settings such that the black line - your current fit - and the yellow line - the best possible fit - align." I really like that as an exercise! Since it is a toggle, we can eventually decide not to show it by default, but I generally like it. To actually move the sliders when "Optimal fit" is pressed is nice.

BUT: I think we should think about a better presentation of all the options and displayed information. What I think would be nice is to have a Legend to explain all the lines, and use the tooltips in ggplotly to properly label each line on hover. Otherwise it gets too confusing with all the information displayed, I agree with that.

Furthermore, I think all plot related radio buttons should be somehow grouped - is it possible to frame them in a box or put a label "Plot" above it or so?

I also found a bug - when you press optimal fit and then reset inputs in the FP tab, only the intercept is reset. Will open an issue if you want, but might go away once we decide for an implementation anyway...