three functions that together find the first trend in a time series. right now, this finds a trend, starting at the beginning of the series, that has the highest R^2 out of all possible trends. it does this by first starting the trend at time=1 and finding an endpoint that maximizes R^2, as long as the trend is at least as long as min_run. Then, it uses that endpoint and tries new start points to try to see if a different start point (other than time=1) will result in a even higher R^2. Finally, with the re-assessed start point, it tries one last time to find the best endpoint.    The next thing to implement is the ability to discard a trend if it is below some threshold.