You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DESCRIPTION
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
Package: TelemetrySpace
2
-
Version: 1.3.0
2
+
Version: 1.3.1
3
3
Title: Spatial point process and random field models for electronic tagging data
4
4
Description: A collection of tools to fit spatial models to several types of telemetry data. Models are provided to account for the detection process when estimating individual centers of activity from acoustic telemetry data and to incorporate data from stationary test transmitters when available. Bayesian versions of models are fitted using Stan (http://mc-stan.org/). Maximum likelihood versions are fitted using Template Model Builder (https://kaskr.github.io/adcomp/index.html).
Copy file name to clipboardExpand all lines: NEWS.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
-
# TelemetrySpace 1.3.0
2
-
- Code refactor, **BREAKING CHANGE**: The structure is now "per individual" (loop) > "per time" (loop) > _vectorized over_ receivers. Because of this, input data must be an array with dimensions 1: individual; 2: time; 3: receiver. Previously it was individual, receiver, time.
1
+
# TelemetrySpace 1.3
2
+
## 1.3.1
3
+
- Code refactor ([PR #13](https://github.com/trackyverse/TelemetrySpace/pull/13)): leverage [Stan's "Includes" framework](https://mc-stan.org/docs/reference-manual/includes.html) to reduce redundant code across files.
4
+
5
+
## 1.3.0
6
+
- Code refactor ([PR #12](https://github.com/trackyverse/TelemetrySpace/pull/12)), **BREAKING CHANGE**: The structure is now "per individual" (loop) > "per time" (loop) > _vectorized over_ receivers. Because of this, input data must be an array with dimensions 1: individual; 2: time; 3: receiver. Previously it was individual, receiver, time.
3
7
-`p0` and `sigma` are generated quantities rather than transformed parameters. This should not affect anything on the user side, but the code runs a bit faster.
4
8
- Calculated distances between receivers and COAs have been moved from the transformed parameters to the model block
5
9
- The model now operates on squared distances rather than Euclidean distance.
Copy file name to clipboardExpand all lines: inst/stan/COA_Standard_gaussian.stan
+10-29Lines changed: 10 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,22 @@
1
1
// Declare data
2
2
data {
3
-
int<lower = 0> nind; // number of individuals
4
-
int<lower = 0> nrec; // number of receivers
5
-
int<lower = 0> ntime; // number of time steps
6
-
int<lower = 0> ntrans; // number of trials/expected number of transmissions per time step
7
-
array[nind, ntime, nrec] int<lower = 0> y; // number of detections for each individual at each receiver in each time step
8
-
vector[nrec] recX; // receiver locations in east-west direction
9
-
vector[nrec] recY; // receiver locations in north-south direction
10
-
vector[2] xlim; // area bounds east-west
11
-
vector[2] ylim; // area boundes north-south
3
+
#includeinclude/shared_data.stan
4
+
}
5
+
6
+
transformed data {
7
+
int logistic =0; // Tells include file to use squared distance
12
8
}
13
9
14
10
// Declare parameters
15
11
parameters {
16
-
// fixed effects
17
-
real<lower = -7, upper = 7> alpha0; // detection probability intercept on the logit scale - bounds are to ensure only searching reasonable parameter space
18
-
real<lower = 0> alpha1; // coef. for decline in detection probability with distance
19
-
20
-
// latent variables
21
-
matrix<lower = xlim[1], upper = xlim[2]> [nind, ntime] sx; // E-W center of activity coordinate - bounds reflect spatial extent
22
-
matrix<lower = ylim[1], upper = ylim[2]> [nind, ntime] sy; // N-S center of activity coordinate - bounds reflect spatial extent
12
+
// detection probability intercept on the logit scale
13
+
// bounds are to ensure only searching reasonable parameter space
Copy file name to clipboardExpand all lines: inst/stan/COA_Standard_logistic.stan
+7-29Lines changed: 7 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,19 @@
1
1
// Declare data
2
2
data {
3
-
int<lower = 0> nind; // number of individuals
4
-
int<lower = 0> nrec; // number of receivers
5
-
int<lower = 0> ntime; // number of time steps
6
-
int<lower = 0> ntrans; // number of trials/expected number of transmissions per time step
7
-
array[nind, ntime, nrec] int<lower = 0> y; // number of detections for each individual at each receiver in each time step
8
-
vector[nrec] recX; // receiver locations in east-west direction
9
-
vector[nrec] recY; // receiver locations in north-south direction
10
-
vector[2] xlim; // area bounds east-west
11
-
vector[2] ylim; // area boundes north-south
3
+
#includeinclude/shared_data.stan
4
+
}
5
+
transformed data {
6
+
int logistic =1; // Tells include file to use linear distance (sqrt)
12
7
}
13
-
14
8
// Declare parameters
15
9
parameters {
16
10
// fixed effects
17
-
real<lower = -7, upper = 7> alpha0; // detection probability intercept on the logit scale - bounds are to ensure only searching reasonable parameter space
18
-
real<lower = 0> alpha1; // coef. for decline in detection probability with distance
19
-
20
-
// latent variables
21
-
matrix<lower = xlim[1], upper = xlim[2]> [nind, ntime] sx; // E-W center of activity coordinate - bounds reflect spatial extent
22
-
matrix<lower = ylim[1], upper = ylim[2]> [nind, ntime] sy; // N-S center of activity coordinate - bounds reflect spatial extent
11
+
real<lower = -5, upper = 5> alpha0; // detection probability intercept on the logit scale - bounds are to ensure only searching reasonable parameter space
12
+
#includeinclude/shared_parameters.stan
23
13
}
24
14
25
15
model {
26
-
// priors
27
-
alpha0 ~cauchy(0, 2.5);
28
-
alpha1 ~cauchy(0, 2.5);
29
-
30
-
for (i in1:nind) {
31
-
for (t in1:ntime) {
32
-
// Calculate euclidean distance (d)
33
-
vector[nrec] d =sqrt(square(recX - sx[i, t]) +square(recY - sy[i, t]));
0 commit comments