rase.slice: Ancestral State Estimation At Any Given Time Slice

Description Usage Arguments Value Author(s) References See Also Examples

Description

Estimates the geographical location of ancestors (at branches or, much less likely, at nodes) at any given point in time integrating over a rase. It first uses tree.slice to identify the branches that the slice intersects with and then uses MCMC sampling to approximate the posterior distribution of the ancestor locations.

Usage

1
2
	rase.slice(tree, slice, res, polygons, 
	params0 = NA, niter = 1000, logevery = 10, nGQ = 20)

Arguments

tree

phylogenetic tree of class "phylo". The same used in the coderase run.

slice

the time at which to slice. It should be in the same units of the phylogenetic tree.

res

output from rase. Ideally, it should be the post-handled mcmc (i.e., already applied burnin and thinning, if applicable).

polygons

list of polygons in owin.object format used as input for rase.

params0

optional. A vector of initial parameter values in the following order: x ancestors for each branch in the order given by tree.slice, followed by y ancestors in the same order.

niter

number of MCMC iterations. By default niter = 1000.

logevery

iteration cycle to print current iteration. By default logevery = 10.

nGQ

degree of the one-dimensional Gauss-Legendre quadrature rule (default = 20) as given by polyCub.SV in package polyCub. Bigger numbers make the integration more precise, but takes longer.

Value

returns a matrix where every column represents one parameter. The first columns (i.e., bX_x; where X = branch 1, ..., branch i) give the ancestral locations for trait x in the order given by tree.slice, followed by the ancestral locations of trait y (i.e., bX_y).

Author(s)

Ignacio Quintero Forrest Crawford

References

Quintero, I., Keil, P., Jetz, W., Crawford, F. W. 2015 Historical Biogeography Using Species Geographical Ranges. Systematic Biology.doi: 10.1093/sysbio/syv057

See Also

tree.slice, rase

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  #load data
  data(rase_data, package = 'rase')	
  	
  ## Not run: 
    # check the data we are going to use
    	
    # examine the mcmc result from rase 
    # after it has been applied a burnin 
    # phase and a thinning
    str(mcmc)
    	
    # the phylogenetic tree used in the rase run
    psophia_tree

    # the polygons used in the rase run
    str(psophia_poly)
    		
    # define the slice of time;
    # for now, let's say 1 Million
    # years ago (Ma)
    slice <- 1

    # Species names of polygons (in order)
    pnames <- c('dextralis', 'viridis', 'leucoptera', 'interjecta', 
      'obscura', 'crepitans', 'ochroptera', 'napensis')

    # name the polygons
    psophia_poly <- name.poly(psophia_poly, psophia_tree, poly.names = pnames)
    	
    # run rase slice for 100 iterations
    slice_results <- rase.slice(psophia_tree, slice = slice, res = mcmc, 
          psophia_poly, niter = 100)
    	
    #check results
    str(slice_results)
  
## End(Not run)

rase documentation built on May 2, 2019, 12:46 p.m.