# Admixture Graph Manipulation and Fitting

## -- B --

 bears Statistics for populations of bears build_edge_optimisation_matrix Build a matrix coding the linear system of edges once the admix variables have been fixed. burn_in Removes the first k rows from a trace.

## -- C --

 calculate_concentration Building a proxy concentration matrix. canonise_expression Used to recognize similar expressions and to possibly simplify them. canonise_graph Canonise graph. coef.agraph_fit Parameters for the fitted graph. cost_function The cost function fed to Nelder-Mead.

## -- E --

 edge Create an edge from a child to a parent. edge_optimisation_function More detailed edge fitting than mere cost_function. eight_leaves_trees Eight leaves trees. evaluate_f4 Evaluates an f_4 statistics in a given environment. examine_edge_optimisation_matrix Examine the edge optimisation matrix to detect unfitted admix variables. extract_admixture_proportion_parameters Extract the admixture proportion parameter from edge specifications. extract_graph_parameters Extract all the parameters a graph contains. extract_trees Extract trees

## -- F --

 f2 Calculate the f_2(A, B) statistics. f3 Calculate the f_3(A; B, C) statistics. f4 Calculate the f_4(W, X; Y, Z) statistics. f4stats Make a data frame an f_4 statistics object. fast_fit A fast version of graph fitting. fast_plot Fast version of graph plotting. filter_on_leaves Filter data so all W, X, Y and Z are leaves in the graph. fitted.agraph_fit Predicted f statistics for the fitted graph. fit_graph Fit the graph parameters to a data set. fit_graph_list Fit lots of graphs to data. fit_permutations_and_graphs Fit lots of graphs to data. five_leaves_graphs Five leaves graphs. format_path Create a path data frame from a list of nodes. four_leaves_graphs Four leaves graphs.

## -- I --

 is_descendant_of Is descendant of. is_negative All overlaps are either empty or have a negative weight. is_positive All overlaps are either empty or have a positive weight. is_unknown Overlapping edges have both positive and negative contributions. is_zero All overlaps are empty.

## -- L --

 log_likelihood Calculate (essentially) the log likelihood of a graph with parameters, given the observation. log_sum_of_logs Computes the log of a sum of numbers all given in log-space.

## -- M --

 make_an_outgroup Make an outgroup. make_mcmc_model Collect the information about a graph and a data set needed to run an MCMC on it. make_permutations List of permutations. model_bayes_factor_n Computes the Bayes factor between two models from samples from their posterior distributions. model_likelihood Computes the likelihood of a model from samples from its posterior distribution. model_likelihood_n Computes the likelihood of a model from samples from its posterior distribution. mynonneg Non negative least square solution.

## -- N --

 no_admixture_events Get the number of admixture events in a graph. no_admixture_events.agraph Get the number of admixture events in a graph. no_admixture_events.agraph_fit Get the number of admixture events in a fitted graph. no_admixture_events.agraph_fit_list Get the number of admixture events in a list of fitted graph. no_poor_fits Get the number of tests in the fit where the predictions fall outside of the error bars. no_poor_fits.agraph_fit Get the number of tests in the fit where the predictions fall outside of the error bars. no_poor_fits.agraph_fit_list Get the number of tests in the fit where the predictions fall outside of the error bars.

## -- O --

 overlaps_sign Get the sign of overlapping paths.

## -- P --

 parent_edges Create the list of edges for an admixture graph. path_overlap Collect the postive and negative overlap between two paths. plot.agraph Plot an admixture graph. plot.agraph_fit Plot the fit of a graph to data. plot.f4stats Plot the fit of a graph to data. plot_fit_1 A plot of the cost function or number of fitted statistics. plot_fit_2 A contour plot of the cost function. poor_fits Get the tests in the fit where the predictions fall outside of the error bars. poor_fits.agraph_fit Get the tests in the fit where the predictions fall outside of the error bars. poor_fits.agraph_fit_list Get the tests in the fit where the predictions fall outside of the error bars. print.agraph_fit Print function for the fitted graph. project_to_population Map sample names to population names.

## -- R --

 remove_duplicates Remove duplicate graphs from a list. rename_nodes Rename nodes. residuals.agraph_fit Errors of prediction in the fitted graph run_metropolis_hasting Run a Metropolis-Hasting MCMC to sample graph parameters.

## -- S --

 seven_leaves_graphs Seven leaves graphs. seven_leaves_trees Seven leaves trees. sf2 Calculate the f_2(A, B) statistics. sf3 Calculate the f_3(A; B, C) statistics. sf4 Calculate the f_4(W, X; Y, Z) statistics. six_leaves_graphs Six leaves graphs. split_population Reverse a projection of samples to populations. split_population.agraph_fit Reverse a projection of samples to populations. split_population.data.frame Reverse a projection of samples to populations. summary.agraph_fit Summary for the fitted graph. sum_of_squared_errors Get the sum of squared errors for a fitted graph. sum_of_squared_errors.agraph_fit Get the sum of squared errors for a fitted graph. sum_of_squared_errors.agraph_fit_list Get the sum of squared errors for a list of fitted graph.

## -- T --

 thinning Thins out an MCMC trace.

## -- V --

 vector_to_graph Vector to graph.