One_way_median_polish: One-way functional median polish from Sun and Genton (2012)

View source: R/One_way_median_polish.R

One_way_median_polishR Documentation

One-way functional median polish from Sun and Genton (2012)

Description

Decomposition by one-way functional median polish.

Usage

One_way_median_polish(Y, n_prefectures=51, year=1959:2020, age=0:100)

Arguments

Y

The multivariate functional data, which are a matrix with dimension n by 2p, where n is the sample size and p is the dimensionality.

year

Vector with the years considered in each population.

n_prefectures

Number of prefectures.

age

Vector with the ages considered in each year.

Value

grand_effect

Grand_effect, a vector of dimension p.

row_effect

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

Author(s)

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", arXiv. \ Sun, Ying, and Marc G. Genton (2012) “Functional Median Polish", Journal of Agricultural, Biological, and Environmental Statistics 17(3), 354-376.

See Also

One_way_Residuals, Two_way_median_polish, Two_way_Residuals

Examples

# The US mortality data  1959-2020, for one populations (female) 
# and 3 states (New York, California, Illinois)
# first define the parameters and the row  partitions.
# Define some parameters.
year = 1959:2020
age = 0:100
n_prefectures = 3

#Load the US data. Make sure it is a matrix. 
Y <-  all_hmd_female_data
# Compute the functional median polish decomposition. 
FMP <- One_way_median_polish(Y,n_prefectures=3,year=1959:2020,age=0:100)
# The results
##1. The funcional grand effect
FGE <- FMP$grand_effect
##2. The funcional row effect
FRE <- FMP$row_effect

ftsa documentation built on May 29, 2024, 2:47 a.m.