If period and cohort effects are taken into account (effects = TRUE) the method uses all available years and diagonals for estimation of the period and cohort effects.

1 2 3 4 5 6 | ```
autoSmoothAPC(data, effects = TRUE, cornerLength = 7,
affdDiagonals = NULL, affdYears = NULL, lower = head(c(0.01, 0.01, 0.01,
2, 0.001, 2, 0.001), 3 + effects * 4), upper = head(c(1.2, 1.8, 1.2, 12,
0.4, 12, 0.4), 3 + effects * 4), init = head(c(0.1, 0.1, 0.2, 4, 0.01, 4,
0.01), 3 + effects * 4), reltol = 0.001, parameters = NULL, trace = F,
control = list(nnzlmax = 1e+06, nsubmax = 2e+06, tmpmax = 2e+05))
``` |

`data` |
Demographic data presented as a matrix. |

`effects` |
Controls if the cohort and period effects are taken into account. |

`cornerLength` |
Sets the smallest length of a diagonal to be considered for cohort effects. |

`affdDiagonals` |
Diagonals to be used for cohort effects. The first diagonal is at the bottom left corner of the data matrix. |

`affdYears` |
Years to be used for period effects. |

`lower` |
Lowest possible values for the optimization procedure. |

`upper` |
Highest possible values for the optimization procedure. |

`init` |
Initial values for the optimization procedure. |

`reltol` |
Relative tolerance parameter to be supplied to |

`parameters` |
Optional model parameters. If not provided, they are estimated. |

`trace` |
Controls if tracing is on. |

`control` |
The control data passed directly to |

A list of four components: smooth surface, period effects, cohort effects and parameters used for smoothing (passed as a parameter or estimated).

Alexander Dokumentov

http://robjhyndman.com/working-papers/mortality-smoothing/

`smoothAPC`

and `signifAutoSmoothAPC`

. The latter might give slightly better performance.

1 2 3 4 5 6 7 8 9 10 11 12 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.