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

Multistrike cones #310

Merged
merged 1 commit into from
Jun 16, 2016
Merged

Multistrike cones #310

merged 1 commit into from
Jun 16, 2016

Conversation

analicia
Copy link
Contributor

New plot draws a green cone of expectation around the out-of-sample returns. When returns drop outside of a cone, a new cone is redrawn. Up to 4 cones are drawn, green, yellow, orange, and red.

@abhijeetkalyan
Copy link
Contributor

Self-assigning, discussed with @twiecki


Returns
-------
ax : matplotlib.Axes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confused me a bit, because it feels like we're returning both ax and fig, whereas what we're actually doing is returning axes if the caller passed them in, and if not, we're returning a new figure. Could we find a way to make that clearer in the docstring?

@abhijeetkalyan
Copy link
Contributor

@ahgnaw can we add a screenshot of what the multiple cones look like to the PR description?


aggregate_returns.plot(ax=axes,
lw=3.,
color='k',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little(very, tbh!) nitpicky, but can we say 'black instead of k here? It's a little more obvious what's going on with the explicit name instead of the shorthand.

@abhijeetkalyan
Copy link
Contributor

Looks great! Just the one comment, then merge when travis is happy

@analicia
Copy link
Contributor Author

no_strikes = 0
image

no_strikes = 3
image

Number of standard devations to use in the boundaries of
the cone. If multiple values are passed, cone bounds will
be generated for each value.
random_seed : int
Seed for the pseudorandom number generator used by the pandas
sample method.
num_strikes : int
Upper limit for number of cones drawn. Can be anything from 0 to 3.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit on the docstring here - if num_strikes is 0, then we'll still have one cone drawn(even though we say in the docstring that the upper limit is 0). What do you think of rephrasing to something like:

num_strikes : int
  Number of times to re-draw a cone if we fall outside the bounds of the previous one. Can be any int from 0 to 3.

@analicia
Copy link
Contributor Author

image

Multistrike cone chart of LinkedIn Stock with live start date of January 25, 2016 and num_strikes = 1

@analicia analicia merged commit 5c54b70 into master Jun 16, 2016
@analicia analicia deleted the multistrike_cones branch June 16, 2016 17:46
@twiecki
Copy link
Contributor

twiecki commented Jun 16, 2016

Awesome work @ahgnaw and @abhijeetkalyan!

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

Successfully merging this pull request may close these issues.

3 participants