parameter.reestimation: uses simulation to determine robustness of parameter...

Description Usage Arguments Details Value Author(s) Examples

View source: R/EvoRAG_Code.R

Description

uses simulation to determine robustness of parameter estimates under a model

Usage

1
   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

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.

Value

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

Author(s)

Jason T. Weir

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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

EvoRAG documentation built on May 2, 2019, 8:57 a.m.