clustNSD: Latent-state model of NSD

Description Usage Arguments Value Examples

View source: R/clustNSD.R

Description

Perform latent-state model to characterize movement patterns based on NSD

Usage

1
2
3
4
5
clustNSD(data, WAIC = FALSE, n.iter = 5000, n.chains = 3,
  n.burnin = floor(n.iter/2), n.thin = max(1, floor((n.iter -
  n.burnin)/1000)), simplify = FALSE, sigma1.max = 0.1, sigma2.max = 0.1,
  sigma1.min = 0.001, sigma2.min = 0.001, mu1.max = 0.5, mu2.max = 1,
  mu1.min = 0, mu2.min = 0, ...)

Arguments

data

a maxtrix with x,y, and time columns

WAIC

save log-likelihood of every iteration to allow calculations of WAIC, default=FALSE

n.iter

number of total iterations per chain (including burn in; default: 5000)

n.chains

number of Markov chains (default: 3)

n.burnin

length of burn in, i.e. number of iterations to discard at the beginning. Default is n.iter/2, that is, discarding the first half of the simulations. If n.burnin is 0, jags() will run 100 iterations for adaption.

n.thin

thinning rate. Must be a positive integer. Set n.thin > 1 to save memory and computation time if n.iter is large. Default is max(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are at least 2000 simulations.

simplify

Convert output to mov.clust object. Default=FALSE. See simple.clust for details

sigma1.max

Upper limit of uniform prior for SD of first normal distribution (Default=0.1)

sigma2.max

Upper limit of uniform prior for SD of second normal distribution (Default=0.1)

sigma1.min

Lower limit of uniform prior for SD of first normal distribution (Default=0.001)

sigma2.min

Lower limit of uniform prior for SD of second normal distribution (Default=0.001)

mu1.max

Upper limit of uniform prior for mean of first normal distribution (Default=0.5)

mu2.max

Upper limit of uniform prior for difference between mean of first and second normal distribution (Default=1)

mu1.min

Lower limit of uniform prior for mean of first normal distribution (Default=0.001)

mu2.min

Lower limit of uniform prior for difference between mean of first and second normal distribution (Default=0)

Value

A rjags or mov.clust object

Examples

1
2
3
4
5
6
7
8
data(Christian)
nsd1<-NSD_fct(Christian$x, Christian$y)
Christian_rjags<-clustNSD(cbind(range01(nsd1), Christian$Time), n.iter=10000, WAIC=T, simplify=F)
summary(simple.clust(Christian_rjags))
data(Zelfa)
nsd2<-NSD_fct(Zelfa$x, Zelfa$y)
Zelfa_rjags<-clustNSD(cbind(range01(nsd2), Zelfa$Time), n.iter=10000, WAIC=F, simplify=F)
summary(simple.clust(Zelfa_rjags))

BastilleRousseau/lsmnsd documentation built on May 5, 2019, 10:30 a.m.