This is the second step in an analysis using limorhyde2, the first is to fit linear models using getModelFit(). This function obtains posterior estimates of coefficients using multivariate adaptive shrinkage (mash), which learns patterns in the data and accounts for noise in the original fits. The defaults for arguments should work well in most cases, so only change them if you know what you're doing.

getPosteriorFit(
  fit,
  covMethod = c("data-driven", "canonical", "both"),
  getSigResArgs = list(),
  npc = fit$nKnots,
  covEdArgs = list(),
  overwrite = FALSE,
  ...
)

Arguments

fit

A limorhyde2 object.

covMethod

String indicating the type(s) of covariance matrices to use for the mash fit.

getSigResArgs

List of arguments passed to mashr::get_significant_results(). Only used if covMethod is 'data-driven' or 'both'.

npc

Number of principal components passed to mashr::cov_pca(). Only used if covMethod is 'data-driven' or 'both'.

covEdArgs

List of arguments passed to mashr::cov_ed(). Only used if covMethod is 'data-driven' or 'both'.

overwrite

Logical for whether to recompute the mash fit if it already exists.

...

Additional arguments passed to mashr::mash().

Value

A limorhyde2 object containing everything in fit with added or updated elements:

  • mashData: mash data object

  • mashFit: mash fit object

  • mashCoefficients: Matrix of posterior mean coefficients, with rows corresponding to features and columns to model terms.

  • mashIdx: Vector indicating which model terms were included in the mash fit.

See also