{"id":16571357,"url":"https://github.com/aariq/efi-2022-phenocam","last_synced_at":"2025-04-04T22:14:03.770Z","repository":{"id":41334279,"uuid":"508366405","full_name":"Aariq/efi-2022-phenocam","owner":"Aariq","description":"Phenocam forecasting challenge done as part of the NEFI short course in 2020 https://ecoforecast.org/nefi2022/","archived":false,"fork":false,"pushed_at":"2022-10-05T20:33:57.000Z","size":12909,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T06:42:21.912Z","etag":null,"topics":["bayesian-models","ecological-modelling","forecasting","forecasting-models"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aariq.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T16:01:05.000Z","updated_at":"2022-07-07T20:30:38.000Z","dependencies_parsed_at":"2023-01-19T07:30:19.824Z","dependency_job_id":null,"html_url":"https://github.com/Aariq/efi-2022-phenocam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aariq%2Fefi-2022-phenocam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aariq%2Fefi-2022-phenocam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aariq%2Fefi-2022-phenocam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aariq%2Fefi-2022-phenocam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aariq","download_url":"https://codeload.github.com/Aariq/efi-2022-phenocam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256113,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-models","ecological-modelling","forecasting","forecasting-models"],"created_at":"2024-10-11T21:22:18.226Z","updated_at":"2025-04-04T22:14:03.756Z","avatar_url":"https://github.com/Aariq.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\"\n)\nlibrary(targets)\n```\n\n# Phenocam Forecast for NEFI summer course 2022\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nTeam:\n\n- [Eric Scott](https://github.com/Aariq)\n- [Yiluan Song](https://github.com/yiluansong)\n- [Ross Alexander](https://github.com/alexanderm10)\n- [Jussi Mäkinen](https://github.com/jusmak)\n\n# Background\n\nPhenocams take automated daily photos of sites like this:\n\n\u003cimg src=\"https://phenocam.nau.edu/data/archive/barrocolorado/2013/03/barrocolorado_2013_03_22_120103.jpg\" width=\"500\"/\u003e\n\nThen photos are converted to values of greenness and redness. These data can be used to forecast date of spring leaf-out or fall color change.\n\n## Challenge\n\n- Predict greenness 35 days ahead from the current day (fixed to early February 2022)\n- Observations start 2016\n\n### 18 study sites in total\n\n- 10 deciduous, 6 grassland, 2 shrubland\n\n```{r echo=FALSE}\ntar_read(ts_plot)\n```\n\n([More data exploration](docs/EDA.md))\n\n## Problems\n\n- account for the between-sites variation in temporal patterns and in response to climate\n- easy access only to most recent climate data, constrained analysis to 2020-\u003e\n\n## Forecasting uncertainty\n\n- model uncertainty\n- climate forecast uncertainty (different forecast ensembles)\n\n\n# Model structure\n\n- https://www.sciencedirect.com/science/article/abs/pii/S0034425720303266\n\nData model\n\n$$GCC_{t, s} \\sim N (X_{t, s}, \\tau_{o, GCC})$$\n$$EVI_{t, s} \\sim N (X_{t, s}, \\tau_{o, EVI})$$\n\nProcess model\n\n$$X_{t, s} \\sim N(X_{t-1, s}+ \\beta_{s} T_{t, s} + \\mu_{s},\\tau_{a})$$\n$$X_{t, s} \\sim N(X_{t-1, s}+ \\beta T_{t, s},\\tau_{a})$$\n$$X_{t, s} \\sim N(X_{t-1, s},\\tau_{a})$$\n\nPriors\n\n$$X_{1, s} \\sim N (mu_{IC, s}, \\tau_{IC, s})$$\n$$\\tau_{o, GCC} \\sim Gamma(a_{o, GCC},r_{o, GCC})$$\n$$\\tau_{o, EVI} \\sim Gamma(a_{o, EVI},r_{o, EVI})$$\n$$\\tau_{a} \\sim Gamma(a_a,r_a)$$\n\n### JAGS code:\n\n```{r echo=FALSE, render='asis', comment=''}\ncat(tar_read(RandomWalk))\n```\n\n\n\n# Forecasts\n\n1) Prepare new data for assimilation\n2) Load posterior as prior/ initialize uninformative prior\n3) Set initial conditions\n4) Configure model\n5) Fit model (and forecast)\n6) Model assessment\n7) Summarize posteriors with hyperparameters (save hyperparameters)\n8) Combine previous data with forecast (save data)\n9) Visualize (save plots)\n\nSome examples\n\n- [2020-11-24](https://github.com/Aariq/efi-2022-phenocam/blob/main/forecasts/2020-11-24/plot.pdf)\n- [2021-07-22](https://github.com/Aariq/efi-2022-phenocam/blob/main/forecasts/2021-07-22/plot.pdf)\n- [2022-05-18](https://github.com/Aariq/efi-2022-phenocam/blob/main/forecasts/2022-05-18/plot.pdf)\n\n\n### `targets` workflow:\n\n```{r echo=FALSE, message=FALSE, warning=FALSE, results='asis'}\ncat(\n  \"```mermaid\",\n  targets::tar_mermaid(targets_only = TRUE, reporter = \"silent\"),\n  \"```\",\n  sep = \"\\n\"\n)\n#this should display correctly on GitHub, or code can be pasted into https://mermaid.live\n```\n\n\n# Resources for Challenge\n\n- [challenge docs](https://projects.ecoforecast.org/neon4cast-docs/theme-phenology.html)\n- [phenocam](https://phenocam.sr.unh.edu/webcam/)\n\n\ngcc data is here:\n\n```r\ngcc_dat \u003c- \n  readr::read_csv(\n    \"https://data.ecoforecast.org/targets/phenology/phenology-targets.csv.gz\",\n    guess_max = 1e6\n  )\n\n```\n\nsite metadata is here:\n\n```r\nsite_data \u003c- \n  readr::read_csv(\n    \"https://raw.githubusercontent.com/eco4cast/neon4cast-phenology/master/Phenology_NEON_Field_Site_Metadata_20210928.csv\"\n    )\n\n```\n\n\n# Repo structure\n\n- `data/` put raw data here\n- `R/` put R functions to be `source()`ed here\n- `docs/` put .Rmd files to be rendered here\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faariq%2Fefi-2022-phenocam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faariq%2Fefi-2022-phenocam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faariq%2Fefi-2022-phenocam/lists"}