CaPow! is a new Shiny web application for open-population capture-recapture models, with an emphasis on study design and model exploration as well as data analysis. The key features are an easy-to-use web interface for designing simulations and models, and efficient computation which enables thousands of simulated datasets to be fitted within seconds. Modelling follows the well-known POPAN style, including a superpopulation with time-varying population sizes, survival rates, and either free birth parameters or a constant population growth rate. Outputs include power analysis of proposed study designs, and diagnostic tools for exploring model precision and effects of model misspecification.

CaPow! runs online in a web browser and does not require any software to be installed. Sessions can be saved and uploaded again for future use.

Watch the video introduction, explore the modules above, or view the presentation slides below for a more detailed explanation.

Note - Any objects that you create in the app will be deleted if you disconnect, refresh the page, hit the back button, or load a previously saved session, so save your work often!

Feedback sent to the email address above would be greatly appreciated, and is likely to guide further development.

Model Name | |

Description | |

Number of Time Periods | |

Superpopulation Size (N_{s}) |

Lambda (λ) | Phi (Φ) | Start time |

**Easy-Fill Panel:**

**Use the examples to fill in an expression.**

e.g. `p(t) or p_%t`

generates p1, p2, p3, ...

e.g. `p(.) or p1 `

generates p1, p1, p1, ...

e.g. `0.1, p2, p3, 0.2, ... `

comma-separated values.

Phi (Φ) | Start time |

**Easy-Fill Panel:**

Probability of Entry

**Use the examples to fill in an expression.**

e.g. `p(t) or p_%t`

generates p1, p2, p3, ...

e.g. `p(.) or p1 `

generates p1, p1, p1, ...

e.g. `0.1, p2, p3, 0.2, ... `

comma-separated values.

**Easy-Fill Panel:**

Survival Rate

Capture Probability

Probability of Entry

**Use the examples to fill in an expression.**

`%t`

generates times 1, 2, 3, ...`_`

pastes strings together

`%t`

generates time labels 1, 2, 3, ...e.g.

`2000 + %t`

generates 2001, 2002, 2003, ...e.g.

`Week_%t`

generates Week1, Week2, Week3, ...e.g.

`p(t) or p_%t`

generates p1, p2, p3, ...e.g.

`0.1, p2, p3, 0.2, ... `

comma-separated values.
The ModelBuilder lets you enter the parameters that you want to estimate, and specify any parameters that will be constrained to equal other parameters (e.g. p1=p2), or any parameters that will be given fixed numerical values and not estimated (e.g. phi=0.9).
#### Parameter names and allowed entries:

Parameters must be entered either as numbers, or as symbols following a specified protocol:#### Entering values:

You can enter values into the entry boxes on the left, or through the EasyFill panel, or directly into the matrix on the right. #### Saving models:

To save your model, tick the Save Model box. The model format will be checked and any errors reported back to you. If you get an error, your model has not been saved and you must untick the box, correct the error, and tick the box again to save the model. If you do not tick Save again, your model will be saved only in temporary draft form and not to the permanent model list. You can open up the draft and save the model by restarting ModelBuilder(), but the draft will be overwritten if you open other models in the interim.

- Superpopulation size is either 'N', or a number greater than 0.
- Annual survival probability, phi, can be 'phi' for a single constant value; 'phi1', 'phi2', ... for time-varying survival; or a number between 0 and 1.
- Annual population growth rate, lambda, is either 'lambda', 'phi', or a number greater than 0. See the Lambda-POPAN tab.
- Capture probabilities are either 'p1', 'p2', ... or numbers between 0 and 1.
- Entry proportions, known as 'probability of entry' or 'pent', are either 'pent1', 'pent2', ... or numbers between 0 and 1. The pent probabilities must sum to 1, so they can not all be estimated freely. The ModelBuilder displays the pent belonging to the first survey time as 'calculated'. This means its value is calculated from the values of the other pent probabilities to ensure that they all sum to 1. However, the parameter still exists: so for example if pent1 displays 'calculated', you can still constrain other pent parameters to be equal to pent1.

**Entering values into the matrix:** Press Enter or click out of the box to commit the change.

**Using the EasyFill Panel:**
The EasyFill panel offers several commonly-used short cuts. Changes will not be applied until the corresponding checkbox is ticked. You should untick the box straight after applying the changes, to avoid confusion when you make subsequent changes in the matrix or switch between model types.

Follow these examples:

- p(.) generates p1, p1, p1, ... Similarly, phi(.) generates phi, phi, phi, ...
- pent(.) generates pent2, pent2, pent2, ... because you probably intend equal pent probabilities
*after*the initial survey. If you want equal pent probabilities for all surveys including the first, then all of the probabilities must be 1/T where T is the number of surveys. Just enter 1/T into the panel as a decimal number for the correct T. - p(t), phi(t), and pent(t) generate fully time-varying results: e.g. p1, p2, p3, ...
- To enter all values without needing to type into the matrix, enter them as comma-separated values: e.g. p1, 0.1, p3, 0.1, ... constrains p2=p4=0.1 whereas p1 and p3 are estimated as free parameters. If there is no survey at a particular time, leave the entry blank or use '-', e.g. p1, , p3 or p1, -, p3, ... if there is no survey at time 2. If you don't enter enough values for all the time periods displayed on the matrix, your entry will be recycled. For example, if there are 5 time periods but you only enter p1, p2, p3, then you will receive p1, p2, p3, p1, p2.
- Special characters for shortcuts are '%t', which generates 1, 2, 3, ..., and the underscore '_', which pastes strings together. For example, entering Week_%t in Time Labels will generate Week1, Week2, Week3, ... because the 1, 2, 3, ... given by %t is pasted to 'Week'.

After you have saved the model, you must untick the Save Model box to continue to edit new models.

In some cases, you will get a warning when saving and you must decide whether you want to continue. These cases are:

- The model name corresponds to a model that is already saved. If you want to continue and overwrite the specified model, enter the requested number in the Confirm Number box and your model will be saved. You can then untick the Save Model box and continue to edit new models.
- The model name corresponds to a model that is already saved
*and*part of a project. The software will not allow you to make changes to a model that is already part of a project. You must either agree to delete the project, including any results, or you must untick the Save Model box and change the name of the model before saving it. - Your model is suspected to be non-identifiable. This can only happen for Standard POPAN models with time-varying p, phi, and pent parameters. It is not possible to estimate all parameters in the full p(t) phi(t) pent(t) model, and some values of p, phi, or pent must be constrained to be equal to others or fixed at numeric values. The software will allow you to continue saving your model, but you should be aware that your results may be suspect and the boxplots should be inspected carefully when you get your CaPow results. The software does not have exhaustive checks for non-identifiability, and a model can be identifiable for some data sets and not for others, so this feature should be taken only as a guideline.

The superpopulation size, N, will cover the period from the first ticked survey to the last ticked survey, regardless of how many time periods are entered here. Time periods must be equally-spaced if using the lambda-POPAN model or the standard POPAN model with single Phi.

- Enter 'N' if N is to be estimated as a free parameter;
- Enter a number if N is to be fixed at that number and not estimated. For example, enter 1000 if constraining N=1000.

- Enter 'p1' if the first capture probability is to be estimated as a free parameter;
- Enter a number if p1 is to be fixed at that number and not estimated;
- Enter 'pt' for another t if the first capture probability is to be constrained equal to the capture probability for time period t. For example, if constraining p1=p2, you can either enter 'p1' under both of the first two time periods, or 'p2' under both of the first two time periods. Note that you can only use pt for a time period if pt is also used for its own time period t.

Survival probability from one time period to the next is phi.

Lambda and phi are constant for all time periods. The minimum value of lambda is phi. Time periods are assumed to be equally-spaced because constant survival and growth is applied to each period.

When a lambda-POPAN model is selected, the pent parameters display 'Calculated'. This means they are calculated from the lambda and phi values and are not estimated as free parameters. Values for pent can not be entered in the matrix. The value of phi can not be entered in the matrix either, but must be entered via the single-phi entry box.

Three entry boxes are displayed for lambda-POPAN models:

- Enter 'lambda' if lambda is to be estimated as a free parameter;
- Enter a number if lambda is to be fixed at that number and not estimated. For example, enter 1.0 if constraining lambda=1 for a population remaining at constant size;
- Enter 'phi' if lambda is to be constrained equal to survival, phi. This represents a population suffering deaths but no births.

If lambda=1 and phi=1, the result is a closed-population model (Model M

- Enter 'phi' if phi is to be estimated as a free parameter;
- Enter a number if phi is to be fixed at that number and not estimated. For example, enter 0.95 if constraining phi=0.95. This can be useful if there is biological knowledge of survival rates and the data are too sparse to enable phi to be estimated effectively.

- Enter the time label for the first survey, e.g. 1 or 2001. Time periods must be equally-spaced for lambda-POPAN models, so time labels are automatically determined from the start time and the number of time periods. The start time should be a number.

Two entry boxes are displayed for single-Phi models:

- Enter 'phi' if phi is to be estimated as a free parameter;
- Enter a number if phi is to be fixed at that number and not estimated. For example, enter 0.95 if constraining phi=0.95. This can be useful if there is biological knowledge of survival rates and the data are too sparse to enable phi to be estimated effectively.

- Enter the time label for the first survey, e.g. 1 or 2001. Time periods must be equally-spaced for single-Phi models, so time labels are automatically determined from the start time and the number of time periods. The start time should be a number.

- Capture probabilities can be entered via the Easy-Fill panel or directly into the matrix.
- Entry proportions can be entered via the Easy-Fill panel or directly into the matrix.

This means that a model of the form p(t)pent(t) is not identifiable, because p1 and pent1 are confounded. (If no survey occurs at time 1, the problem applies to the first time at which there is a survey.)

To unconfound these parameters, choose another p to make equal to p1, or another pent to make equal to pent1. Note that pent1 is listed as 'Calculated', but you can still enter pent1 as the pent parameter for any other time t.

The software will allow you to save a model suspected to be non-identifiable, but you should be careful that outputs from the model are likely to be unreliable. Check the boxplots and other CaPow results carefully for evidence of problems.

- You can use 'phi' everywhere, to give a single-phi model with or without equal time-spacing; or you can use phi1, phi2, ... to give time-varying Phi. However, you may not mix these two types of symbols. Only a single 'phi' everywhere,
*or*the symbols phi1, phi2, ..., are accepted. If you do mix the symbols, you will get an error when you try to save your model. - Every value of phi corresponds to survival
*between*two time periods. The phi that you enter at time period 1 corresponds to survival*between*times 1 and 2; and so on for the other times. There is no phi entry from the last ticked survey time onwards, because we can not estimate survival after the end of the surveys. - The software expects you to enter Phi values for intermediate times even if surveys do
*not*take place, because the process of survival must continue regardless of survey occurrence. If you do not wish to specify Phi values in survey gaps, you should redefine your time periods so that you do not have survey gaps. For example, if you have surveys in years 2001, 2003, and 2008, you could set the matrix to have three time periods with labels 2001, 2003, and 2008, and two different Phi values: the first (entered under 2001) to control survival between 2001 and 2003; and the second (entered under 2003) to control survival between 2003 and 2008. - If you prefer to specify your model with survey gaps, and to assign a parameter for Phi across these gaps, you may only use Phi parameters that are associated with survey times. For example, if surveys occur in 2001, 2003, and 2008, you might decide that you want to use parameter phi1 to describe survival from 2001-2 and 2002-3, parameter phi3 for survival from 2003-4 and 2004-5, and parameter phi1 again for 2005-6, 2006-7, and 2007-8, basing your choice on years with similar weather conditions. You may only use phi1 and phi3, because these are the only years (prior to the last) at which surveys occur. Note also the comments below about identifiability of this model. Alternatively, any Phi parameters can be entered as numerical values to avoid estimating them.

- Capture probabilities can be entered via the Easy-Fill panel or directly into the matrix.
- Entry proportions can be entered via the Easy-Fill panel or directly into the matrix.

For standard-POPAN models, you have a completely free choice of how you describe your time periods, and whether or not they are equally spaced. These are for your reference only, and will not be used in model fitting.

Additionally, when capture probabilities and phi parameters are time-varying, there is confounding between the last p (associated with the last ticked survey) and the last phi (associated with the penultimate ticked survey), because there is no later information to distinguish between animals that survived the last time period but were not detected in the last survey, and those that died before the last survey.

This means that a model of the form p(t)pent(t) is not identifiable, because the first p and the first pent are confounded. Similarly, a model of the form p(t)phi(t) is not identifiable, because the last p and the last phi are confounded.

To unconfound the first p and pent, choose another p to make equal to p1, or another pent to make equal to pent1. Note that pent1 is listed as 'Calculated', but you can still enter pent1 as the pent parameter for any other time t. (If there is no survey at time 1, the same applies to the first time at which there is a survey.)

To unconfound the last p and phi, choose another p to make equal to the last p, or another phi to make equal to the last phi (corresponding to the penultimate ticked survey).

The software will allow you to save a model suspected to be non-identifiable, but you should be careful that outputs from the model are likely to be unreliable. Check the boxplots and other CaPow results carefully for evidence of problems.

Sim Name | |

Description | |

Number of Time Periods | |

Superpopulation Size (N_{s}) |

Lambda (λ) | Phi (Φ) | Start time |

**Easy-Fill Panel:**

**Use the examples to fill in an expression.**

e.g. `0.2 `

generates 0.2, 0.2, 0.2, ...

e.g. `0.1, 0.2, 0.3, ... `

comma-separated values.

Phi (Φ) | Start time |

**Easy-Fill Panel:**

Probability of Entry

**Use the examples to fill in an expression.**

e.g. `0.2 `

generates 0.2, 0.2, 0.2, ...

e.g. `0.1, 0.2, 0.3, ... `

comma-separated values.

**Easy-Fill Panel:**

Capture Probability

Survival Rate

Probability of Entry

**Use the examples to fill in an expression.**

`%t`

generates times 1, 2, 3, ...`_`

pastes strings together

`%t`

generates time labels 1, 2, 3, ...e.g.

`2000 + %t`

generates 2001, 2002, 2003, ...e.g.

`Week_%t`

generates Week1, Week2, Week3, ...e.g.

`0.2 `

generates 0.2, 0.2, 0.2, ...e.g.

`0.1, 0.2, 0.3, ... `

comma-separated values.
This tab enables you to calculate the superpopulation size, N_{s}, under the assumptions of a lambda-POPAN model with constant lambda and constant phi, given the desired population size at a single specified time, which we will call the *base time, t*.*Or:*_{s}: for example, you can specify there should be E(N_{1999})=300 animals in 1999, and find the correct superpopulation size N_{s} for the period 2001-2014.**Output:**

For example, you can find the correct superpopulation size N_{s} for the period 2001 to 2014 inclusive, such that the expected population size in 2003 is E(N_{2003})=400 animals. The base time is t=2003, and the base population size is E(N_{t})=400.

**Accommodating Survey Gaps:**

The N_{s} value covers the total number of animals that were ever *exposed to a survey*. If there are gaps between surveys, some animals may be born and die within a gap and are omitted from the superpopulation. You can accommodate survey gaps by using the entry box 'Surveys' instead of the 'Start' and 'End' boxes.

To set the input parameters, enter:

- Values for lambda and phi;
- The base time, t (e.g. 2003);
- The base population size at this time, E(N
_{t}) (e.g. 400).

To set the time range over which N_{s} will be calculated, *either* :

- Enter the start time for N
_{s}(e.g. 2001), and the end time for N_{s}(e.g. 2014), and**leave the 'Surveys' box blank**. The calculator will assume that surveys occur at every intermediate timepoint.

- Enter the survey times as a comma-separated list. Use a dash (-) or colon (:) to indicate ranges. For example, entering '1-3, 8, 10:12' will give the times 1, 2, 3, 8, 10, 11, 12.

The 'Start' and 'End' boxes are ignored if the 'Surveys' box has an entry.

The base time does not need to be in the range specified by NConstant values of lambda and phi will be assumed for the full span of time embracing the base time and the N_{s} period. Time points are assumed equally spaced, and must be integers.

- The Cumulative N
_{s}column shows the superpopulation size from the first survey specified up to and including the time shown. - The p
_{ent}column shows the entry proportions at each survey time corresponding to the survey configuration specified. - The E(N
_{t}) column shows the average number of animals in the population at each survey time. The actual number will vary about the average due to natural variability in birth and death.

Lambda (λ) | Phi (Φ) | Base time, t | Base pop, E(N_{t}) |

Start time | End time | Or: |
Surveys, e.g. 2001-2003, 2008, 2014 |

The SimBuilder lets you enter the parameter values you want to simulate from. The set of values you choose is called the 'simset' for short.
#### Parameter values and allowed entries:

Parameter values must be numbers following these rules:#### Entering values:

You can enter values into the entry boxes on the left, or through the EasyFill panel, or directly into the matrix on the right. #### Saving SimSets:

To save your simset, tick the Save Sim box. The entries will be checked and any errors reported back to you. If you get an error, your simset has not been saved and you must untick the box, correct the error, and tick the box again to save the simset. If you do not tick Save again, your simset will be saved only in temporary draft form and not to the permanent simset list. You can open up the draft and save the simset by restarting SimBuilder(), but the draft will be overwritten if you open other simsets in the interim.

- Superpopulation size is a number greater than 0.
- Annual survival probability, phi, is a number between 0 and 1.
- Annual population growth rate, lambda, is a number greater than 0. Lambda must be no less than phi. See the Lambda-POPAN tab.
- Capture probabilities are numbers between 0 and 1.
- Entry proportions, known as 'probability of entry' or 'pent', are numbers greater than 0. The pent probabilities must sum to 1, but you can enter them as relative numbers in the 'Relative p
_{ent}' column and let the software rescale them. For example, if you enter pent = 3, 1, 1 in the 'Relative p_{ent}' column, they will be scaled with the denominator (3+1+1) = 5, to display 3/5, 1/5, 1/5 in the scaled 'p_{ent}' column to the right of the matrix. - Fractions like '1/5' must be entered as decimal values (e.g. 0.2).

**Entering values into the matrix:** Press Enter or click out of the box to commit the change.

**Using the EasyFill Panel:**
The EasyFill panel offers several short cuts. Changes will not be applied until the corresponding checkbox is ticked. You should untick the box straight after applying the changes, to avoid confusion when you make subsequent changes in the matrix or switch between model types.

Follow these examples:

- Entering a single number, like 0.2, generates 0.2, 0.2, 0.2, ...
- To enter all values without needing to type into the matrix, enter them as comma-separated values: e.g. 0.4, 0.3, 0.4, ... . If there is no survey at a particular time, leave the entry blank or use '-', e.g. 0.4, , 0.4 or 0.4, -, 0.4, ... if there is no survey at time 2. If you don't enter enough values for all the time periods displayed on the matrix, your entry will be recycled. For example, if there are 5 time periods but you only enter 0.1, 0.2, 0.3, then you will receive 0.1, 0.2, 0.3, 0.1, 0.2.
- Special characters for shortcuts are '%t', which generates 1, 2, 3, ..., and the underscore '_', which pastes strings together. For example, entering Week_%t in Time Labels will generate Week1, Week2, Week3, ... because the 1, 2, 3, ... given by %t is pasted to 'Week'.

After you have saved the simset, you must untick the Save Sim box to continue to edit new simsets.

In some cases, you will get a warning when saving and you must decide whether you want to continue. These cases are:

- The simset name corresponds to a simset that is already saved. If you want to continue and overwrite the specified simset, enter the requested number in the Confirm Number box and your simset will be saved. You can then untick the Save Sim box and continue to edit new simsets.
- The simset name corresponds to a simset that is already saved
*and*part of a project. The software will not allow you to make changes to a simset that is already part of a project. You must either agree to delete the project, including any results, or you must untick the Save Sim box and change the name of the simset before saving it.

The superpopulation size, N, will cover the period from the first ticked survey to the last ticked survey, regardless of how many time periods are entered here. Time periods must be equally-spaced if using the lambda-POPAN model or the standard POPAN model with single Phi.

- Enter a number greater than 0 for the superpopulation size.

- Enter numbers between 0 and 1 for the capture probabilities.

- The 'p
_{ent}' column displays pent values scaled so that they sum to 1, so that you can enter them in the 'Relative p_{ent}' column as relative values (e.g. 3, 1, 1, ...) if you wish. - The 'E(N
_{t})' column shows the expected numbers of animals in the population in each time period, derived from the N_{s}, Φ, and λ or p_{ent}parameters that you have specified. Across survey gaps, the animals already present are allowed to die. However, new animals only enter the population at survey times, because the superpopulation is defined to be the number of animals ever available for capture. Any animals that are born and die within a survey gap are not counted and are not included in the E(N_{t}) column.

Survival probability from one time period to the next is phi.

Lambda and phi are constant for all time periods. The minimum value of lambda is phi. Time periods are assumed to be equally-spaced because constant survival and growth is applied to each period.

When a lambda-POPAN model is selected, the 'Relative p

Three entry boxes are displayed for lambda-POPAN models:

- Enter a number greater than 0 for lambda. The number must be greater than or equal to the value specified for phi.

- Enter a number between 0 and 1 for phi.

- Enter the time label for the first survey, e.g. 1 or 2001. Time periods must be equally-spaced for lambda-POPAN models, so time labels are automatically determined from the start time and the number of time periods. The start time should be a number.

Two entry boxes are displayed for single-Phi models:

- Enter a number between 0 and 1 for phi.

- Enter the time label for the first survey, e.g. 1 or 2001. Time periods must be equally-spaced for single-Phi models, so time labels are automatically determined from the start time and the number of time periods. The start time should be a number.

- Capture probabilities can be entered via the Easy-Fill panel or directly into the matrix.
- Entry proportions can be entered via the Easy-Fill panel or directly into the 'Relative p
_{ent}' column on the matrix. You can enter them as relative values (not summing to 1) if you wish. The 'p_{ent}' column displays the values scaled so that they sum to 1.

- Each phi should be a number between 0 and 1.
- Each phi corresponds to survival
*between*two time periods. The phi that you enter at time period 1 corresponds to survival*between*times 1 and 2; and so on for the other times. There is no phi entry from the last ticked survey time onwards, because we do not simulate survival after the end of the surveys. - The software expects you to enter phi values for intermediate times even if surveys do not take place, because the process of survival must continue regardless of survey occurrence. If you do not wish to specify phi values in survey gaps, you should redefine your time periods so that you do not have survey gaps. For example, if you have surveys in years 2001, 2003, and 2008, you could set the matrix to have three time periods with labels 2001, 2003, and 2008, and two different phi values: the first (entered under 2001) to control survival between 2001 and 2003; and the second (entered under 2003) to control survival between 2003 and 2008.

- Capture probabilities can be entered via the Easy-Fill panel or directly into the matrix.
- Entry proportions can be entered via the Easy-Fill panel or directly into the 'Relative p
_{ent}' column on the matrix. You can enter them as relative values (not summing to 1) if you wish. The 'p_{ent}' column displays the values scaled so that they sum to 1.

For standard-POPAN models, you have a completely free choice of how you describe your time periods, and whether or not they are equally spaced. These are for your reference only, and will not be used in model fitting.

N | lambda | phi | p | pent |

Title | Text | Axis | Limits |

Clear Space: |
Header | Footer |

N | lambda | phi | p | pent |

N | lambda | phi | p | pent |

Title | Text | Axis | Points |

N | lambda | phi | p | pent |

Title | Axis | Points |

Clear Space: |
Header | Footer |

TrueValue: generating value for simulations |

meanEst: mean of estimated values |

relativeBias: (meanEst - TrueValue) / TrueValue |

empiricalSD: standard deviation of estimated values |

empiricalCV: coefficient of variation (CV) of estimated values = empiricalSD / meanEst |

RMSE: root mean squared error = sqrt[ mean{ (Estimates - TrueValue)^{2 } } ] |

meanSE: mean of estimated standard errors = mean { sqrt( Variance Estimates ) } |

meanEstCV: mean of estimated CVs = mean { sqrt( Variance Estimates ) / Parameter Estimates } |

medCIwidth: median width of confidence intervals |

CIcover: percentage of simulations for which the confidence interval encloses TrueValue |

Overall Power (%): percentage of simulations in which the queried value is outside the confidence interval. Specifies power to detect the true parameter differs from the queried value. |

CI Above (%): the CI lies wholly above the queried value. Specifies power to detect the true parameter is greater than the queried value. |

CI Below (%): the CI lies wholly below the queried value. Specifies power to detect the true parameter is less than the queried value. |

N | lambda | phi | p | pent |

Title | Axis | Points |

Clear Space: |
Header | Footer |