public class StepwiseAdditiveModelFitter
A multi-threaded stepwise model fitter for additive only models. To use it first construct an object then call runAnalysis(). After the analysis has run, any of several reports will be available using getters. If a permutation test is requested it is run first. The analysis then fits SNPs consecutively, then rescans the full model to determine if any of the SNPs has a better choice given all the other SNPs in the model. As part of the rescan it calculates a support interval for each of the SNPs. Reports available include the steps taken to fit the model with sequential p-values, an anova with marginal p-values, a report of marker effects, a post-scan anova, post-scan marker effects, and a permutation report. It will also output a list of model residuals by chromosome. For each chromosome, it reports the residuals from a model that includes all effects, except the markers on that chromosome.
protected GenotypePhenotype myGenoPheno
protected GenotypeTable myGenotype
protected Phenotype myPhenotype
protected java.util.List<net.maizegenetics.phenotype.PhenotypeAttribute> dataAttributeList
protected java.util.List<net.maizegenetics.phenotype.PhenotypeAttribute> covariateAttributeList
protected java.util.List<net.maizegenetics.phenotype.PhenotypeAttribute> factorAttributeList
protected java.lang.String dataname
protected kotlin.Array[] y
protected java.lang.String currentTraitName
protected java.util.List<net.maizegenetics.stats.linearmodels.ModelEffect> myModel
protected int numberOfBaseEffects
protected SweepFastLinearModel mySweepFast
protected BitSet missing
protected java.util.List<net.maizegenetics.analysis.modelfitter.AdditiveSite> mySites
protected FactorModelEffect nestingFactor
protected java.util.List<java.lang.String> nestingFactorLevelNames
protected double rescanAlpha
protected java.util.List<net.maizegenetics.phenotype.Phenotype> allOfTheResidualPhenotypes
protected int numberOfPermutations
protected double permutationAlpha
protected double enterLimit
protected double exitLimit
protected boolean useReferenceProbability
protected net.maizegenetics.analysis.modelfitter.AdditiveSite.CRITERION modelSelectionCriterion
protected int maxSitesInModel
protected boolean createAnovaReport
protected boolean createPostScanEffectsReport
protected boolean createPreScanEffectsReport
protected boolean createStepReport
protected boolean createResidualsByChr
protected TableReportBuilder markerEffectReportBuilder
protected TableReportBuilder markerEffectCIReportBuilder
protected TableReportBuilder permutationReportBuilder
public StepwiseAdditiveModelFitter(GenotypePhenotype genopheno, java.lang.String datasetName)
genopheno - a GenotypePhenotype objectdatasetName - a name for the genophenoIllegalArgumentException - if any phenotype data is missingpublic java.util.Optional<java.lang.String> testPhenotypeForMissingData(Phenotype pheno)
pheno - a Phenotypepublic void runAnalysis()
This is called to run the analysis
protected void fitModel()
protected java.util.List<net.maizegenetics.stats.linearmodels.ModelEffect> baseModel(PhenotypeAttribute phenotypeBeingTested)
protected double forwardStep(double prevCriterionValue)
protected void addToStepsReport(int siteNumber,
SweepFastLinearModel theModel,
java.lang.String action,
kotlin.Array[] siteSSdf,
kotlin.Array[] errorSSdf,
double F,
double p)
protected java.util.List<kotlin.Array[]> scanToFindCI()
protected kotlin.Array[] findCI(ModelEffect me, java.util.List<net.maizegenetics.stats.linearmodels.ModelEffect> theModel)
protected double testAddedTerm(int testedTerm,
AdditiveSite addedTerm,
java.util.List<net.maizegenetics.stats.linearmodels.ModelEffect> theModel)
protected AdditiveSite bestTerm(java.util.List<net.maizegenetics.stats.linearmodels.ModelEffect> baseModel, kotlin.Array[] interval)
public void runPermutationTest()
protected void addToAnovaReport(java.util.Optional<java.util.List> intervalList)
protected void addToMarkerEffectReport(boolean CI)
public void numberOfPermutations(int nperm)
public void permutationAlpha(double alpha)
public void enterLimit(double limit)
public void exitLimit(double limit)
public void useReferenceProbability(boolean useRefProb)
public void isNested(boolean nested)
public void nestingEffectName(java.lang.String factorName)
public void modelSelectionCriterion(net.maizegenetics.analysis.modelfitter.AdditiveSite.CRITERION criterion)
public void maxSitesInModel(int maxSites)
public void useResiduals(boolean useResid)
public void createAnovaReport(boolean createIt)
public void createPostScanEffectsReport(boolean createIt)
public void createPreScanEffectsReport(boolean createIt)
public void createResidualsByChr(boolean createIt)
public void createStepReport(boolean createIt)
public TableReport getAnovaReport()
public TableReport getAnovaReportWithCI()
public TableReport getMarkerEffectReport()
public TableReport getMarkerEffectReportWithCI()
public java.util.List<net.maizegenetics.phenotype.Phenotype> getResidualPhenotypesByChromosome()
public TableReport getPermutationReport()
public TableReport getSteps()
public static double aic(double RSS,
int N,
double modelDf)
public static double bic(double RSS,
int N,
double modelDf)
public static double mbic(double RSS,
int N,
double modelDf,
int numberOfSites)