Implementing the MAR-1 Algorithm A conceptual walkthrough.

Post on 29-Jan-2016

220 views 0 download

Tags:

transcript

Implementing the MAR-1 Algorithm

A conceptual walkthrough

Steps for Implementing MAR-1 models Ecological decisions

Data formatting Data transformations Model selection Estimated MAR-1 parameter given

model Model fit metrics, model fit diagnostics Stability properties Bootstrap confidence intervals

Step 1: Make ecological decisions What interactions are you interested in?

Do you have enough data?

Step 1: Make ecological decisions

Insects

Plants

Birds

Are you missing major players in your community?

Step 1: Make ecological decisions

VariateCovariate

Make apriori decisions to simplify the foodweb based on ecological knowledge about the system.

Step 1: Make ecological decisions

rainfall temperature hunting pressure date

years since last fire rabies prevalence storm frequency

road density

What are the important abiotic covariates?

Step 1: Complex system reduced to a smaller set of variates and covariates to address the interactions of interest

Step 2: Format the data

No missing values

One column for each variate and covariate

One row for each time step

Step 3: Transform the data

LN

Counts for species should be transformed by the natural logarithm.

Step 3: Transform the data

LN

You may need to transform by z-scores also if the data are on very different scales.

Z

Step 3: Specify the relationship between the co-variates and the rates of growth

0

2

4

6

8

10

12

0 2 4 6

Covariate value

Rainfall

Rodents

Insects

)ln)1(exp( ,,1, ttjijtiti cunbann

Spp covariates would be ln transformed to be consistent with the MAR framework

The relationship for biotic covariates is system specific

Step 3: Transform the co-variates

?

The transformation for the abiotic covariates is determined by the relationship between covariates and spp growth rates. The best transformation is not necessarily a natural logarithm.

Step 4: Choose the Model Selection Method Compare a specified set of candidate models

testing a set of particular hypotheses want to use a restricted set of prior models (over

which the best is picked or over which models are averaged).

Step 4: Choose the Model Selection Method Compare a specified set of candidate models

testing a set of particular hypotheses want to use a restricted set of prior models (over

which the best is picked or over which models are averaged).

Search over the set of all possible models constrain models by known interactions rank models by a model selection metric (such as

AIC or BIC) select the best fit model or use a model average

Step 4: Choose a model comparison approach Compare a specified set of candidate models

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

1

1

1

11

11

00 0

0 0

0

0

0

0

Rainfall

Hawks

Foxes

Lizards

Snakes

0

1

0

1

Mice1

1

1

0

Insects0

0

0

1

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

1

1

1

11

11

10 1

1 1

0

1

1

1

Rainfall

Hawks

Foxes

Lizards

Snakes

0

1

0

1

Mice1

1

1

0

Insects0

0

0

1

Spars

e m

odel

Full m

odel

Search over all models and choose the best

Step 4: Choose a model comparison approach

A. Begin with a proposed model (randomly selected)

1 = included interaction0 = excluded interaction

Step 4: Choose a model comparison approach

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

1

1

1

11

11

10 1

1 1

0

1

1

1

Rainfall

Hawks

Foxes

Lizards

Snakes

0

1

0

1

Mice1

1

1

0

Insects0

0

0

1

Step 5: Iterate through the possible models (CLS method)

A. Begin with a proposed model (randomly selected)

B. Perform a CLS regression on the proposed model to get values for the included interactions

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

0.25

0.79

0.55

0.61-0.51

0.090.22

00 0

0 0

0

0

0

0

Rainfall

Hawks

Foxes

Lizards

Snakes

0

0.05

0

0.11

Mice

0.11

0.05

0.21

0

Insects

-0.15

0.27

0

0.55

Step 5: Iterate through the possible models (CLS method)

C. Use this model to compute the Akaike or Bayesian Information Criterion for that model (AIC or BIC)

A. Begin with a proposed model (randomly selected)

B. Perform a CLS regression on the proposed model to get values for the included interactions

Step 5: Iterate through the possible models (CLS method)D. Randomly change one matrix element to its opposite

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

1

1

1

11

11

00 0

0 0

0

0

0

0

Rainfall

Hawks

Foxes

Lizards

Snakes

0

1

0

1

Mice

1

1

1

0

Insects

1

1

0

1

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

1

1

1

11

11

00 0

0 0

0

0

1

0

Rainfall

Hawks

Foxes

Lizards

Snakes

0

1

0

1

Mice

1

1

1

0

Insects

1

1

0

1

Step 5: Iterate through the possible models (CLS method)

D. Randomly change one matrix element to its opposite

E. Re-run the CLS regression, find the AIC or BIC, and compare

Step 5: Iterate through the possible models (CLS method)

G. If the new model has a lower AIC/BIC, keep it. Otherwise, keep the old one.

D. Randomly change one matrix element to its opposite

E. Re-run the CLS regression, find the AIC or BIC, and compare

Step 5: Iterate through the possible models (CLS method)

G. If the new model has a lower AIC/BIC, keep it. Otherwise, keep the old one.

D. Randomly change one matrix element to its opposite

E. Re-run the CLS regression, find the AIC or BIC, and compare

H. Repeat hundreds of times, until you have the model that generates the lowest possible AIC

Step 5: Iterate through the possible models (CLS method)I. The search procedure finds the model that best

explains the data with the lowest AIC or BIC

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

0.89

0.54

0.15

0.39-0.51

00.27

00 0

0 -0.28

0

0.14

0

0

Rainfall

Hawks

Foxes

Lizards

Snakes

0

-0.04

0

0.11

Mice

0.54

0.15

0.21

0

Insects

-0.11

0.18

0

0.56

Step 6: Compute stability propertiesOnce you know the interaction matrix, and the covariance matrix, you can compute the stability properties of the stationary distribution X

Step 6: Compute stability properties Variance of the stationary distribution

eigenvalues det(B)2/p

Step 6: Compute stability properties Variance of the stationary distribution

eigenvalues det(B)2/p

Return time to the stationary distribution max(B)

max(BB)

Step 6: Compute stability properties Variance of the stationary distribution

eigenvalues det(B)2/p

Return time to the stationary distribution max(B) max(BB)

Reactivity of the stationary distribution max(BB)-1 -tr()/tr(V)

Step 7: Bootstrap re-sampling To obtain CIs on the parameter estimates, one

can perform bootstrap re-sampling.

Step 7: Bootstrap re-sampling To obtain CIs on the parameter estimates, one

can perform bootstrap re-sampling

Basically, you scramble up the Et matrices To create a bootstrapped E time series From which you create a bootstrapped X time

series

XXtt = = AA + + BB XXt t --1 1 + + CC UUt-1t-1 + + EEtt

Step 7: Bootstrap re-sampling To obtain CIs on the parameter estimates, one

can perform bootstrap re-sampling

Repeat thousands of times to create thousands of bootstrapped data sets

From each bootstrapped data set, one re-estimates the A, B, and C matrices to get bootstrapped confidence intervals

XXtt = = AA + + BB XXt t --1 1 + + CC UUt-1t-1 + + EEtt

Step 7: Bootstrap estimates example

Hawks Foxes Lizards Snakes

Hawks

Foxes

Lizards

Snakes

0.25 (0.20,0.30)

0.79 (0.59, 0.99)

0.55 (0.43, 0.67)

0.61 (0.54, 0.68)-0.51 (-0.62, -0.40)

0.09 (0.07, 0.11)0.22 (0.16, 0.28)

00 0

0.07 (-0.03, 0.17) 0

0.05 (0.01, 0.09)

0

0

0

Means with 95% CI ranges (made up example)

Can obtain CIs on A and C matrices and on all the stability metrics also in the same way.

Data Transformations

Type of model selection

Manually specify model

Search over all model possibilities

Estimate A, B, & Cmatrices

Estimate stability metrics, model fit diagnostics, and model selection metrics

Bootstrap to obtain bootstrapped CIs

Use simulation to test robustness of assumptions

That’s a lot of work. It would be nice if there was a computer program that could do it all for you….

That’s a lot of work. It would be nice if there was a computer program that could do it all for you….

There is! There is! (We will show it to you after lunch (We will show it to you after lunch and use it in the hands-on section.)and use it in the hands-on section.)