Learn R Programming

ftsa (version 6.4)

Two_way_median_polish: Two-way functional median polish from Sun and Genton (2012)

Description

Decomposition by two-way functional median polish

Usage

Two_way_median_polish(Y, year=1959:2020, age=0:100, n_prefectures=51, n_populations=2)

Value

grand_effect

grand_effect, a vector of dimension p

row_effect

row_effect, a matrix of dimension length(row_partition_index) by p.

col_effect

col_effect, a matrix of dimension length(column_partition_index) by p

Arguments

Y

A matrix with dimension n by 2p. The functional data.

year

Vector with the years considered in each population.

n_prefectures

Number of prefectures

age

Vector with the ages considered in each year.

n_populations

Number of populations.

Author

Cristian Felipe Jimenez Varon, Ying Sun, Han Lin Shang

References

C. F. Jimenez Varon, Y. Sun and H. L. Shang (2023) ``Forecasting high-dimensional functional time series: Application to sub-national age-specific mortality".

Sun, Ying, and Marc G. Genton (2012) ``Functional Median Polish", Journal of Agricultural, Biological, and Environmental Statistics, 17(3), 354-376.

See Also

FANOVA

Examples

Run this code
# The US mortality data  1959-2020 for two populations and three states 
# (New York, California, Illinois)
# Compute the functional median polish decomposition.
FMP = Two_way_median_polish(cbind(all_hmd_male_data, all_hmd_female_data), 
		n_prefectures = 3, year = 1959:2020, age = 0:100, n_populations = 2)

##1. The functional grand effect
FGE = FMP$grand_effect
##2. The functional row effect
FRE = FMP$row_effect
##3. The functional column effect
FCE = FMP$col_effect

Run the code above in your browser using DataLab