R/internal.postRunSimulateFromMeans.R

Defines functions postRunSimulateFromMeans

# internal.postRunSimulateFromMeans.R

# postRunSimulateFromMeans
# internal function

# a function that would take a tree, models and means of parameters
	# and then simulate data using those means as fixed priors

postRunSimulateFromMeans <- function(prcOut, verbose = TRUE){
	# a function that would take a tree, models and means of parameters
		# and then simulate data using those means as fixed priors
	# 
	# needs to be output from a single Run
	if ( inherits(prcOut, "multiRun_doRun_prc") ) {
		if(verbose){
			message("Multiple runs of doRun_prc found, using means from the first run")
			}
        prcOut <- prcOut[[1]]
        }
	#
	char <- doSimulation(
		phy = prcOut$phy, 
		generation.time = prcOut$generation.time, 
		intrinsicFn = prcOut$intrinsicFn, 
		extrinsicFn = prcOut$extrinsicFn, 
		startingValues = prcOut$parMeansList$starting, 
		intrinsicValues = prcOut$parMeansList$intrinsic, 
		extrinsicValues = prcOut$parMeansList$extrinsic
		)
	#
	return(char)
	}
bomeara/treevo documentation built on Aug. 19, 2023, 6:52 p.m.