CreateModeOfVarPlotLQ2D: Transformation Mode of Variation Plot

Description Usage Arguments Details References See Also Examples

View source: R/CreateModeOfVarPlotLQ2D.R

Description

Create the k-th transformation mode of variation plot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CreateModeOfVarPlotLQ2D(
  fpcaObj,
  domain = "D",
  k = 1,
  dSup = NULL,
  Qvec = -2:2,
  alpha = 0,
  useAlpha = FALSE,
  ...
)

Arguments

fpcaObj

An FPCA class object returned by FPCA() on the log quantile density functions.

domain

should the mode be plotted in LQD ('Q') or density space ('D', the default).

k

The k-th mode of variation to plot (default k = 1)

dSup

The common support of the original densities. Only relevant for domain = 'D'

Qvec

Vector of values Q to be plotted. If 0 is not included, it will be added (default is -2:2). Only relevant for domain = 'D'

alpha

(De)regularisation parameter (default is 0). See details.

useAlpha

logical - should deregularisation be performed? Default:FALSE

...

Additional arguments for the 'plot' function.

Details

If domain = 'D' (the default), the a transformation mode of variation is plotted. The red-line is psi^(-1)(nu), where nu is the mean in LQD space and psi is the LQD transformation. Other lines correspond to perturbations by adding multiples of the LQD eigenfunctions rho_k (with eigenvalues tau_k) : psi^(-1)(nu + Q sqrt{tau_k} rho_k for the values Q in Qvec. If alpha is positive, will attempt to deregularise (see DeregulariseByAlpha). This will throw an error if alpha is too large.

If domain = 'Q', ordinary modes of variation are plotted in LQD space (see documentation for CreateModeOfVarPlot in fdapace).

References

Functional Data Analysis for Density Functions by Transformation to a Hilbert space, Alexander Petersen and Hans-Georg Mueller, 2016

See Also

DeregulariseByAlpha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Densities for Top 50 Male Baby Names
data(Top50BabyNames)
x = Top50BabyNames$x

# Perform Transformation FPCA for male baby name densities
X = FPCAdens(dmatrix = t(Top50BabyNames$dens$male), dSup = Top50BabyNames$x, useAlpha = TRUE, 
                  optns = list(dataType = 'Dense', error = FALSE, methodSelectK = 2))

# Plot Modes

Qvec = quantile(X$xiEst[,1], probs = c(0.1, 0.25, 0.75, 0.9))/sqrt(X$lambda[1])
CreateModeOfVarPlotLQ2D(X, k = 1, dSup = x, Qvec = Qvec, main = 'First Mode, Density Space')
CreateModeOfVarPlotLQ2D(X, domain = 'Q', k = 1, dSup = x, Qvec = Qvec, 
                            main = 'First Mode, LQD space')

Qvec = quantile(X$xiEst[,2], probs = c(0.1, 0.25, 0.75, 0.9))/sqrt(X$lambda[2])
CreateModeOfVarPlotLQ2D(X, k = 2, dSup = x, Qvec = Qvec, main = 'Second Mode, Density Space')
CreateModeOfVarPlotLQ2D(X, domain = 'Q', k = 2, dSup = x, Qvec = Qvec, 
                            main = 'Second Mode, LQD space')

fdadensity documentation built on Dec. 5, 2019, 9:07 a.m.