Documentation and plot fix for multiplicative seasonality

This commit is contained in:
Ben Letham 2018-05-28 12:37:23 -07:00
parent 916b3552af
commit cbe1f5e623
5 changed files with 319 additions and 45 deletions

View file

@ -0,0 +1 @@
ds,y 1949-01-01,112 1949-02-01,118 1949-03-01,132 1949-04-01,129 1949-05-01,121 1949-06-01,135 1949-07-01,148 1949-08-01,148 1949-09-01,136 1949-10-01,119 1949-11-01,104 1949-12-01,118 1950-01-01,115 1950-02-01,126 1950-03-01,141 1950-04-01,135 1950-05-01,125 1950-06-01,149 1950-07-01,170 1950-08-01,170 1950-09-01,158 1950-10-01,133 1950-11-01,114 1950-12-01,140 1951-01-01,145 1951-02-01,150 1951-03-01,178 1951-04-01,163 1951-05-01,172 1951-06-01,178 1951-07-01,199 1951-08-01,199 1951-09-01,184 1951-10-01,162 1951-11-01,146 1951-12-01,166 1952-01-01,171 1952-02-01,180 1952-03-01,193 1952-04-01,181 1952-05-01,183 1952-06-01,218 1952-07-01,230 1952-08-01,242 1952-09-01,209 1952-10-01,191 1952-11-01,172 1952-12-01,194 1953-01-01,196 1953-02-01,196 1953-03-01,236 1953-04-01,235 1953-05-01,229 1953-06-01,243 1953-07-01,264 1953-08-01,272 1953-09-01,237 1953-10-01,211 1953-11-01,180 1953-12-01,201 1954-01-01,204 1954-02-01,188 1954-03-01,235 1954-04-01,227 1954-05-01,234 1954-06-01,264 1954-07-01,302 1954-08-01,293 1954-09-01,259 1954-10-01,229 1954-11-01,203 1954-12-01,229 1955-01-01,242 1955-02-01,233 1955-03-01,267 1955-04-01,269 1955-05-01,270 1955-06-01,315 1955-07-01,364 1955-08-01,347 1955-09-01,312 1955-10-01,274 1955-11-01,237 1955-12-01,278 1956-01-01,284 1956-02-01,277 1956-03-01,317 1956-04-01,313 1956-05-01,318 1956-06-01,374 1956-07-01,413 1956-08-01,405 1956-09-01,355 1956-10-01,306 1956-11-01,271 1956-12-01,306 1957-01-01,315 1957-02-01,301 1957-03-01,356 1957-04-01,348 1957-05-01,355 1957-06-01,422 1957-07-01,465 1957-08-01,467 1957-09-01,404 1957-10-01,347 1957-11-01,305 1957-12-01,336 1958-01-01,340 1958-02-01,318 1958-03-01,362 1958-04-01,348 1958-05-01,363 1958-06-01,435 1958-07-01,491 1958-08-01,505 1958-09-01,404 1958-10-01,359 1958-11-01,310 1958-12-01,337 1959-01-01,360 1959-02-01,342 1959-03-01,406 1959-04-01,396 1959-05-01,420 1959-06-01,472 1959-07-01,548 1959-08-01,559 1959-09-01,463 1959-10-01,407 1959-11-01,362 1959-12-01,405 1960-01-01,417 1960-02-01,391 1960-03-01,419 1960-04-01,461 1960-05-01,472 1960-06-01,535 1960-07-01,622 1960-08-01,606 1960-09-01,508 1960-10-01,461 1960-11-01,390 1960-12-01,432
1 ds y 1949-01-01 112 1949-02-01 118 1949-03-01 132 1949-04-01 129 1949-05-01 121 1949-06-01 135 1949-07-01 148 1949-08-01 148 1949-09-01 136 1949-10-01 119 1949-11-01 104 1949-12-01 118 1950-01-01 115 1950-02-01 126 1950-03-01 141 1950-04-01 135 1950-05-01 125 1950-06-01 149 1950-07-01 170 1950-08-01 170 1950-09-01 158 1950-10-01 133 1950-11-01 114 1950-12-01 140 1951-01-01 145 1951-02-01 150 1951-03-01 178 1951-04-01 163 1951-05-01 172 1951-06-01 178 1951-07-01 199 1951-08-01 199 1951-09-01 184 1951-10-01 162 1951-11-01 146 1951-12-01 166 1952-01-01 171 1952-02-01 180 1952-03-01 193 1952-04-01 181 1952-05-01 183 1952-06-01 218 1952-07-01 230 1952-08-01 242 1952-09-01 209 1952-10-01 191 1952-11-01 172 1952-12-01 194 1953-01-01 196 1953-02-01 196 1953-03-01 236 1953-04-01 235 1953-05-01 229 1953-06-01 243 1953-07-01 264 1953-08-01 272 1953-09-01 237 1953-10-01 211 1953-11-01 180 1953-12-01 201 1954-01-01 204 1954-02-01 188 1954-03-01 235 1954-04-01 227 1954-05-01 234 1954-06-01 264 1954-07-01 302 1954-08-01 293 1954-09-01 259 1954-10-01 229 1954-11-01 203 1954-12-01 229 1955-01-01 242 1955-02-01 233 1955-03-01 267 1955-04-01 269 1955-05-01 270 1955-06-01 315 1955-07-01 364 1955-08-01 347 1955-09-01 312 1955-10-01 274 1955-11-01 237 1955-12-01 278 1956-01-01 284 1956-02-01 277 1956-03-01 317 1956-04-01 313 1956-05-01 318 1956-06-01 374 1956-07-01 413 1956-08-01 405 1956-09-01 355 1956-10-01 306 1956-11-01 271 1956-12-01 306 1957-01-01 315 1957-02-01 301 1957-03-01 356 1957-04-01 348 1957-05-01 355 1957-06-01 422 1957-07-01 465 1957-08-01 467 1957-09-01 404 1957-10-01 347 1957-11-01 305 1957-12-01 336 1958-01-01 340 1958-02-01 318 1958-03-01 362 1958-04-01 348 1958-05-01 363 1958-06-01 435 1958-07-01 491 1958-08-01 505 1958-09-01 404 1958-10-01 359 1958-11-01 310 1958-12-01 337 1959-01-01 360 1959-02-01 342 1959-03-01 406 1959-04-01 396 1959-05-01 420 1959-06-01 472 1959-07-01 548 1959-08-01 559 1959-09-01 463 1959-10-01 407 1959-11-01 362 1959-12-01 405 1960-01-01 417 1960-02-01 391 1960-03-01 419 1960-04-01 461 1960-05-01 472 1960-06-01 535 1960-07-01 622 1960-08-01 606 1960-09-01 508 1960-10-01 461 1960-11-01 390 1960-12-01 432

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -118,6 +118,8 @@ def plot_components(
if npanel == 1:
axes = [axes]
multiplicative_axes = []
for ax, plot_name in zip(axes, components):
if plot_name == 'trend':
plot_forecast_component(
@ -145,8 +147,13 @@ def plot_components(
plot_seasonality(
m=m, name=plot_name, ax=ax, uncertainty=uncertainty,
)
if plot_name in m.component_modes['multiplicative']:
multiplicative_axes.append(ax)
fig.tight_layout()
# Reset multiplicative axes labels after tight_layout adjustment
for ax in multiplicative_axes:
ax = set_y_as_percent(ax)
return fig