Learn R Programming

EvoRAG (version 2.0)

parameter.reestimation: uses simulation to determine robustness of parameter estimates under a model

Description

uses simulation to determine robustness of parameter estimates under a model

Usage

parameter.reestimation(GRAD, TIME, model, PARAMETERS, N, REP = 1)

Arguments

GRAD
vector of gradient values (i.e. any continuous variable) for sister pair dataset
TIME
vector of evolutionary ages (i.e. node ages ) for sister pair dataset
model
any model implemented in EvoRAG
PARAMETERS
A vector listing the model parameters under which to simulate. Model parameters must be in the same order as described in sisterContinuous.
REP
How many replicated datasets of TIME and GRAD to use. Default = 1. Example: REP=3 generates a dataset with each element in TIME and GRAD repeated 3 times. This option will be used primarily for calculating statistical power as a function of increasing number of sister pairs
N
The number of simulations to perform

Value

Returns a matrix showing the mean, median, range, several percentiles and the standard error for each model parameter.

Details

Simulates data under a model, and re-estimates model parameters using the same model. A model performs well if the parameters it is simulated under are similar to those it re-estimates.

Examples

Run this code
## Not run: 
#   ###simulate data
#   set.seed(seed = 3)
#   TIME = runif(n=300, min = 0, max = 10)
#   GRAD = runif(n=300, min = 0, max = 60)
#   DATA1 <- sim.sisters(TIME = TIME, GRAD=GRAD, parameters = c(2, -0.03), 
#      model=c("BM_linear"))
# 
#   ###run parameter.reestimation
#   model = c("BM_linear")
#   parameter.reestimation(GRAD, TIME, model=model, PARAMETERS=c(2, -0.03), 
#      N=100, REP = 1)
#  ## End(Not run)#end dontrun

Run the code above in your browser using DataLab