Skip to content

Commit

Permalink
CLN: Rename parameters and fix pandas issue
Browse files Browse the repository at this point in the history
Avoid .values and use asarray
Use params consistently in api
  • Loading branch information
bashtage committed Sep 28, 2018
1 parent 68f67ba commit f78b62e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 6 deletions.
5 changes: 2 additions & 3 deletions arch/univariate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def forecast(self, params, horizon=1, start=None, align='origin', method='analyt
rng : callable, optional
Custom random number generator to use in simulation-based forecasts.
Must produce random samples using the syntax `rng(size)` where size
is a tuple containing the dimension of the random values.
the 2-element tuple (simulations, horizon).
Returns
-------
Expand Down Expand Up @@ -1088,8 +1088,7 @@ def forecast(self, params=None, horizon=1, start=None, align='origin', method='a
rng : callable, optional
Custom random number generator to use in simulation-based forecasts.
Must produce random samples using the syntax `rng(size)` where size
is either a scalar or a tuple containing the dimension of the
random values.
the 2-element tuple (simulations, horizon).
Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions arch/univariate/mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _fit_no_arch_normal_errors(self, cov_type='robust'):
self._is_pandas, opt, fit_start, fit_stop,
copy.deepcopy(self))

def forecast(self, parameters, horizon=1, start=None, align='origin',
def forecast(self, params, horizon=1, start=None, align='origin',
method='analytic', simulations=1000, rng=None):
# Check start
earliest, default_start = self._fit_indices
Expand All @@ -640,8 +640,8 @@ def forecast(self, parameters, horizon=1, start=None, align='origin',
'variables used to fit the first observation. In this model, '
'this value is {0}.'.format(max(0, earliest - 1)))
# Parse params
parameters = np.asarray(parameters)
mp, vp, dp = self._parse_parameters(parameters)
params = np.asarray(params)
mp, vp, dp = self._parse_parameters(params)

#####################################
# Compute residual variance forecasts
Expand Down
73 changes: 73 additions & 0 deletions doc/source/_static/css/overrides.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
body {
font-size: 14px;
}

.sidebar-toc {
font-size: 13px;
}

blockquote {
font-size: 14px;
}

code, pre, tt {
font-size: 14px;
font-family: Consolas, monospace;
}

code, tt {
color: #428bca;
}

div.seealso {
background-color: #f9f9f9;
border: none;
}

.m { color: #05003b} /* Literal.Number */
.mf { color: #05003b } /* Literal.Number.Float */
.mh { color: #05003b } /* Literal.Number.Hex */
.mi { color: #05003b } /* Literal.Number.Integer */
.mo { color: #05003b } /* Literal.Number.Oct */
.il { color: #05003b } /* Literal.Number.Integer.Long */

.descname { font-size: 17px; color: #378ae2; }


.output_area table {
margin-left: 0;
margin-right: auto;
border: none;
border-collapse: collapse;
border-spacing: 0;
color: black;
table-layout: fixed;
}
.output_area thead {
border-bottom: 1px solid black;
vertical-align: bottom;
}
.output_area tr,
.output_area th,
.output_area td {
text-align: right;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: none;
}
.output_area th {
font-weight: bold;
}
.output_area tbody tr:nth-child(odd) {
background: #f5f5f5;
}
.output_area tbody tr:hover {
background: rgba(66, 165, 245, 0.2);
}

.simpletable caption { font-weight: bold }

.label { color: #333 }
7 changes: 7 additions & 0 deletions doc/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{# Import the theme's layout. #}
{% extends "!layout.html" %}

{%- block extrahead %}
{{ super() }}
<link rel="stylesheet" href="{{ pathto('_static/css/overrides.css', 1) }}" type="text/css" />
{% endblock %}

0 comments on commit f78b62e

Please sign in to comment.