Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
mafa.Rd 1.56 KiB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mafa.R
\name{mafa}
\alias{mafa}
\title{Min/Max Autocorrelation Factors Analysis (MAFA) in time (or 1D)}
\usage{
mafa(x, time = NULL, nreal = 1000, nmafs = 3, seed = NULL, contr_var = NULL)
}
\arguments{
\item{x}{matrix or data frame containing time series of multiple variables.}
\item{time}{vector of time units that will be used for the output.}
\item{nreal}{integer; the number of realizations that should be performed.}
\item{nmafs}{the number of retained MAFs (default is 3).}
\item{seed}{integer; a number for the random number generator state.}
\item{contr_var}{integer; the number of variables with highest contribution to show in the loading plots.}
}
\description{
Min/Max Autocorrelation Factors Analysis (MAFA) in time (or 1D)
}
\details{
MAFA is a multivariate statistical method, that allows the set of initial variables to be
decomposed into factors. The autocorrelation of which decreases, or the variogram increases,
when going from the first factors to the last ones. Hence the very first factors extract
the part of the variables which is the most continuous in time.
The function for this code is adopted from Wollez et al. 2009 (\url{https://doi.org/10.1051/alr/2009020})
}
\examples{
df <- data.frame(variable1variabl = 1:20, variable2= rnorm(20, 100, 30), variable3 = 1:20 + rnorm(20))
mafa(x = df, time = 1981:2000)
df <- matrix(rnorm(1000), ncol = 50)
colnames(df) <- paste0(letters[1:25], rep(1:2,each = 25))
mafa(df, contr_var = 10)
}
\seealso{
\url{https://doi.org/10.1051/alr/2009020}
}