five

Supplement 1. R code used for simulation.

收藏
Figshare2016-08-09 更新2026-04-29 收录
下载链接:
https://figshare.com/articles/dataset/Supplement_1_R_code_used_for_simulation_/3550842
下载链接
链接失效反馈
官方服务:
资源简介:
File List Simulation code.r – Source code to run simulation analysis Description This is the complete code for simulating usage under different environmental scenarios of food/cover availability and fitting GFR models to the synthetic data. The end of the listing contains the following three functions: environ(d,x): Creates a square dxd arena containing a total of x units of resource. The function introduces spatial autocorrelation via kernel smoothing of the resource units. Kernel smoothed map is re-normalized to ensure that x is conserved. movement(d, env1, env2) : This function contains the movement simulation. The parameters pertaining to animal behavior are locally defined, so the function operates as a wrapper. Its input is the dimensionality d of the square arena and the two environmental layers (env1 and env2). Its output is a map of usage. predict.lmer(mod, newdat) : Generates predictions from the fixed effects of mixed model. The main body of the code has the following parts: 1. Initialization Parameters regulating the arena size, number of environmental scenarios and overall availabilities of each resource in the arena for each scenario. 2. Simulation The functions environ() and movement() are used to generate resource distributions and resulting usage for each environmental scenario. 3. Model fitting Here, the data frame is extended with columns for expectations of the two resources in each scenario and four GFR models are fit to the augmented data frame. 4. Model validation This part first inspects the goodness-of-fit of the models. It then generates data for a new environmental scenario with unobserved availabilities. The model fitted in part 3 is then used to make predictions about the new scenario. Then follow several different outputs that aim to visualize and quantify the quality of the resulting predictions.
创建时间:
2016-08-09
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作