遇见数据集

Supplement 1. The code and sample data for state–space analysis of Argos movement data.

收藏
Figshare2016-08-05 更新2026-04-29 收录
官方服务:

资源简介:

File List Files for running analyses from the WinBUGS gui (Windows or Linux) DCRW.txt WinBUGS code for "DCRW" model, a first-difference correlated random walk 2 KB DCRWS.txt WinBUGS code for "DCRWS" model, a first-difference CRW with switching 2 KB hsdata.txt Hooded seal movement data 12 KB hsDCRWinits.txt Hooded seal initial values for DCRW model 3 KB hsDCRWSinits.txt Hooded seal initial values for DCRWS model 5 KB gs617data.txt Grey seal 617 movement data 59 KB gs617DCRWinits.txt Grey seal 617 initial values for DCRW model 3 KB gs617DCRWSinits.txt Grey seal 617 initial values for DCRWS model 4 KB gs2986data.txt Grey seal 2986 movement data 71 KB gs2986DCRWinits.txt Grey seal 2986 initial values for DCRW model 3 KB gs2986DCRWSinits.txt Grey seal 2986 initial values for DCRWS model 5 KB Files for running analyses by calling WinBUGS from within R (Linux) DCRW.rbugs.R R script for fitting DCRW model to hooded seal data 1 KB DCRWS.rbugs.R R script for fitting DCRWS model to hooded seal data 1 KB dat4bugs.R R code required by DCRW.rbugs.R and DCRW.rbugs.R 4 KB hseal.dat Hooded seal data for analysis from within R (Linux) 6 KB gs617.dat Grey seal 617 data for analysis from within R (Linux) 27 KB gs2986.dat Grey seal 2986 data for analysis from within R (Linux) 35 KB allfiles.zip All files together 48 KB DescriptionWinBUGS version 1.4.1 was used to run the code and is freely available at http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml. In Windows, to run the DCRW model on the hooded seal data, open DCRW.txt in WinBUGS and paste in the data file hsdata.txt and hsDCRWinits.txt. For all models we ran 2 chains for 40 000 samples with a 20 000-sample burn-in and retained every 5th sample to reduce autocorrelation. See the WinBUGS manual, included with the software, for further details on running the models. Follow the same procedure to run models on the other datasets. Summary statistics and plots can be generated directly in WinBUGS or from other software by exporting results as text files. Alternatively, one can call WinBUGS from within R, a freely available statistical computing environment, using the R2WinBUGS package (see http://www.stat.columbia.edu/~gelman/bugsR/ for details). In Linux, WinBUGS can be run via Wine (available at http://www.winehq.com/). We recommend building Wine from sourcerather than installing the binary files (see documentation included in Wine download for details). We have found that WinBUGS works flawlessly using the 20050524 release of Wine compiled on Ubuntu Linux. In Linux, WinBUGS can be run via the gui (as above) or called from within R using the rbugs package (available on the CRAN site at http://www.r-project.org). We provide sample R scripts and associated R code (in File list) to illustrate this approach for both the DCRW and DCRWS models. Note that in addition to the rbugs package, these scripts also require the chron package (available on the CRAN site at http://www.r-project.org). The following commands in R will fit the DCRW model to the hooded seal data: source('~/pathtofile/dat4bugs.R') hseal.dat source('~/pathtofile/DCRW.rbugs.R') The scripts provided run the hooded seal analyses with a timestep of 1 day. The scripts will need to be modified to run analyses on the grey seal datasets with a timestep of 2 days. Note, also, that the path names in the scripts will need to be altered to reflect your file structure. The scripts create a data.frame object in R that contains all samples, after burn-in and thinning, for each of the unobserved states and model parameters. These can be summarized, for example by plotting the posterior densities: plot(density(hsealDCRW.out$gamma))

### 文件列表 #### 一、适用于通过WinBUGS图形用户界面(WinBUGS,支持Windows与Linux系统)运行分析的文件 DCRW.txt:用于"DCRW"模型的WinBUGS代码,即一阶差分相关随机游走模型,大小2 KB DCRWS.txt:用于"DCRWS"模型的WinBUGS代码,即带切换的一阶差分相关随机游走模型,大小2 KB hsdata.txt:冠海豹运动数据集,大小12 KB hsDCRWinits.txt:冠海豹DCRW模型初始值文件,大小3 KB hsDCRWSinits.txt:冠海豹DCRWS模型初始值文件,大小5 KB gs617data.txt:灰海豹617号个体运动数据集,大小59 KB gs617DCRWinits.txt:灰海豹617号个体DCRW模型初始值文件,大小3 KB gs617DCRWSinits.txt:灰海豹617号个体DCRWS模型初始值文件,大小4 KB gs2986data.txt:灰海豹2986号个体运动数据集,大小71 KB gs2986DCRWinits.txt:灰海豹2986号个体DCRW模型初始值文件,大小3 KB gs2986DCRWSinits.txt:灰海豹2986号个体DCRWS模型初始值文件,大小5 KB #### 二、适用于通过R语言(R)调用WinBUGS运行分析的文件(Linux系统) DCRW.rbugs.R:用于为冠海豹数据集拟合DCRW模型的R脚本,大小1 KB DCRWS.rbugs.R:用于为冠海豹数据集拟合DCRWS模型的R脚本,大小1 KB dat4bugs.R:DCRW.rbugs.R与DCRWS.rbugs.R所需的R代码文件,大小4 KB hseal.dat:用于R语言(Linux系统)下分析的冠海豹数据集,大小6 KB gs617.dat:用于R语言(Linux系统)下分析的灰海豹617号个体数据集,大小27 KB gs2986.dat:用于R语言(Linux系统)下分析的灰海豹2986号个体数据集,大小35 KB allfiles.zip:全部文件打包归档,大小48 KB ### 数据集说明 本数据集使用WinBUGS 1.4.1版本运行代码,该软件可从http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml免费获取。 在Windows系统中,若需在冠海豹数据集上运行DCRW模型,请在WinBUGS中打开DCRW.txt,并导入数据文件hsdata.txt与hsDCRWinits.txt。所有模型均运行2条马尔可夫链,采集40000个样本,舍弃前20000个样本作为预烧期,并每间隔5个样本保留1个以降低自相关性。关于模型运行的更多细节,请参阅软件附带的WinBUGS用户手册。对其他数据集运行模型的操作步骤与此一致。 可直接在WinBUGS中生成汇总统计量与绘图,或将结果导出为文本文件后通过其他软件完成分析。此外,也可通过R2WinBUGS软件包(详情请参阅http://www.stat.columbia.edu/~gelman/bugsR/)在R语言这一免费统计计算环境中调用WinBUGS。 在Linux系统中,可通过Wine运行WinBUGS(Wine可从http://www.winehq.com/获取)。我们建议从源代码编译安装Wine,而非直接安装二进制文件(详情请参阅Wine下载包附带的文档)。经测试,在Ubuntu Linux系统上编译的20050524版本Wine可完美运行WinBUGS。在Linux系统中,可通过图形用户界面运行WinBUGS(如前文所述),或通过rbugs软件包(可从CRAN站点http://www.r-project.org获取)在R语言中调用WinBUGS。我们提供了示例R脚本与相关R代码(详见文件列表),以演示针对DCRW与DCRWS模型的该实现方式。请注意,除rbugs软件包外,这些脚本还需要chron软件包(可从CRAN站点http://www.r-project.org获取)。 在R语言中执行以下命令即可为冠海豹数据集拟合DCRW模型: source('~/pathtofile/dat4bugs.R') hseal.dat source('~/pathtofile/DCRW.rbugs.R') 本脚本针对冠海豹数据集的分析采用1天的时间步长。若要对灰海豹数据集运行分析,需将时间步长修改为2天,同时需修改脚本中的文件路径以匹配您的本地文件结构。 脚本会在R中创建一个data.frame(数据框)对象,包含所有经预烧期剔除与稀疏化处理后的未观测状态与模型参数的全部样本。可对其进行汇总分析,例如绘制后验密度图:plot(density(hsealDCRW.out$gamma))

创建时间:
2016-08-05
二维码
社区交流群
二维码
科研交流群
商业服务