signifAutoSmoothAPC: Smooths demographic data using automatically estimated...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/auto.l1tp.smooth.R

Description

It is a heuristic procedure which tries to figure out positions of period and cohort effects in the data. It also uses a few steps to estimate model's parameters. The procedure is supposed to outperform autoSmoothAPC slightly.

Usage

1
2
3
4
5
signifAutoSmoothAPC(data, p.value = 0.05, cornerLength = 7,
  lower = c(0.01, 0.01, 0.01, 1, 0.001, 1, 0.001), upper = c(1.2, 1.8, 1.2,
  12, 0.4, 12, 0.4), init = c(0.1, 0.1, 0.2, 4, 0.001, 4, 0.001),
  reltol = 0.001, trace = F, control = list(nnzlmax = 1e+06, nsubmax =
  2e+06, tmpmax = 2e+05), weights = NULL)

Arguments

data

Demographic data (log mortality) presented as a matrix. Row numbers represent ages and column numbers represet time.

p.value

P-value used to test the period and the cohort effects for significance. The lower the value the fewer diagonals and years will be used to find cohort and period effects.

cornerLength

Minimal length of a diagonal to be considered for cohort 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 optim function.

trace

Controls if tracing is on.

control

The control data passed directly to rq.fit.sfn function.

weights

Define how much every observation effect the resulting smooth surface. The parameter must have same dimentions as data parameter. Weights can be set to reciprocal of estimated standard deviation of the data.

Value

A list of six components: smooth surface, period effects, cohort effects, parameters used for smoothing, diagonals used for cohort effects and years used for period effects.

Author(s)

Alexander Dokumentov

References

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

See Also

autoSmoothAPC, smoothAPC.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

library(demography)
m <- log(fr.mort$rate$female[1:30, 120:139])
plot(m)
sm <- signifAutoSmoothAPC(m)
plot(sm)
plot(sm, "surface")
plot(sm, "period")
plot(sm, "cohort")


## End(Not run)

smoothAPC documentation built on Sept. 14, 2017, 5:03 p.m.