35
Implementing the MAR-1 Algorithm A conceptual walkthrough

Implementing the MAR-1 Algorithm

  • Upload
    cale

  • View
    54

  • Download
    0

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: Implementing the MAR-1 Algorithm

Implementing the MAR-1 Algorithm

A conceptual walkthrough

Page 2: Implementing the MAR-1 Algorithm

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

Page 3: Implementing the MAR-1 Algorithm

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

Do you have enough data?

Page 4: Implementing the MAR-1 Algorithm

Step 1: Make ecological decisions

Insects

Plants

Birds

Are you missing major players in your community?

Page 5: Implementing the MAR-1 Algorithm

Step 1: Make ecological decisions

VariateCovariate

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

Page 6: Implementing the MAR-1 Algorithm

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?

Page 7: Implementing the MAR-1 Algorithm

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

Page 8: Implementing the MAR-1 Algorithm

Step 2: Format the data

No missing values

One column for each variate and covariate

One row for each time step

Page 9: Implementing the MAR-1 Algorithm

Step 3: Transform the data

LN

Counts for species should be transformed by the natural logarithm.

Page 10: Implementing the MAR-1 Algorithm

Step 3: Transform the data

LN

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

Z

Page 11: Implementing the MAR-1 Algorithm

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

Page 12: Implementing the MAR-1 Algorithm

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.

Page 13: Implementing the MAR-1 Algorithm

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).

Page 14: Implementing the MAR-1 Algorithm

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

Page 15: Implementing the MAR-1 Algorithm

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

Page 16: Implementing the MAR-1 Algorithm

Search over all models and choose the best

Step 4: Choose a model comparison approach

Page 17: Implementing the MAR-1 Algorithm

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

Page 18: Implementing the MAR-1 Algorithm

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

Page 19: Implementing the MAR-1 Algorithm

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

Page 20: Implementing the MAR-1 Algorithm

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

Page 21: Implementing the MAR-1 Algorithm

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

Page 22: Implementing the MAR-1 Algorithm

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

Page 23: Implementing the MAR-1 Algorithm

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

Page 24: Implementing the MAR-1 Algorithm

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

Page 25: Implementing the MAR-1 Algorithm

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

Page 26: Implementing the MAR-1 Algorithm

Step 6: Compute stability properties Variance of the stationary distribution

eigenvalues det(B)2/p

Page 27: Implementing the MAR-1 Algorithm

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)

Page 28: Implementing the MAR-1 Algorithm

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)

Page 29: Implementing the MAR-1 Algorithm

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

can perform bootstrap re-sampling.

Page 30: Implementing the MAR-1 Algorithm

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

Page 31: Implementing the MAR-1 Algorithm

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

Page 32: Implementing the MAR-1 Algorithm

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.

Page 33: Implementing the MAR-1 Algorithm

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

Page 34: Implementing the MAR-1 Algorithm

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

Page 35: Implementing the MAR-1 Algorithm

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.)