When initially choosing tuning penalties, it can be challenging to find the appropriate scale. This function fits either spacemap or space once for a specified tuning grid on the whole data. It reports the corresponding number of \(y-y\) edges and \(x-y\) edges for each tuning penalty set. Having a prior understanding of how sparse the network ought to be can help narrow the scale of the tuning grid based on the output of this function.

initFit(Y, X = NULL, tuneGrid, method = c("spacemap", "space"),
  iscale = TRUE, aszero = 1e-06, ...)

Arguments

Y

Numeric matrix \((N \times Q)\) containing N iid samples of the response vector \(\textbf{y}\).

X

Numeric matrix \((N \times P)\) containing N iid samples of the predictor vector \(\textbf{x}\).

tuneGrid

Named with columns lam1, lam2, lam3 when method = "spacemap". Each row in the data.frame corresponds to a tuning parameter set that is input into spacemap. When method = "space", supply a data.frame with only one column being lam1.

method

Character vector indicates network inference with function spacemap when method = "spacemap" or function space when method = "space". If X is non-null and method = "space", then space will infer (x--x, x--y, y--y) edges but only report (x--y, y--y) edges.

iscale

Logical indicating to standardize the whole input data. Defaults to TRUE. See base::scale(x, center = TRUE, scale = TRUE) for details of standardization.

aszero

Positive numeric value (defaults to 1e-6) indicating at what point to consider extremely small parameter estimates of \(\Gamma\) and \(\rho\) as zero.

...

Additional arguments for spacemap or space to change their default settings (e.g. setting tol = 1e-4).

Value

If method=="spacemap" or (method=="space" and X!=NULL), return a data.frame where the first column nyy reports the number of \(y-y\) edges and the second column nxy reports the number of \(x-y\) edges. Rows of the data.frame correspond to the input parameter tuneGrid. If method=="space" and X==NULL, return a vector of the number of \(y-y\) edges.

See also

cvVote