Commit b29e11bc authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

update notebook metadata to select R kernel

parent 75324e21
No related merge requests found
Showing with 10 additions and 14 deletions
+10 -14
%% Cell type:markdown id: tags:
## `evalhyd-r` demonstration
%% Cell type:code id: tags:
``` python
``` R
library(evalhyd)
```
%% Cell type:markdown id: tags:
### Deterministic evaluation
%% Cell type:markdown id: tags:
Define streamflow observations
%% Cell type:code id: tags:
``` python
``` R
# shape: {1, time: 4}
obs <- rbind(
c(4.7, 4.3, 5.5, 2.7)
)
```
%% Cell type:markdown id: tags:
Define streamflow predictions
%% Cell type:code id: tags:
``` python
# shape: {series: 1, time:4}
``` R
# shape: {series: 1, time: 4}
prd <- rbind(
c(5.3, 4.2, 5.7, 2.3)
)
```
%% Cell type:markdown id: tags:
Compute Nash-Sutcliffe efficiency
%% Cell type:code id: tags:
``` python
``` R
# shape: {series: 1, subsets: 1, samples: 1}
evalhyd::evald(obs, prd, c("NSE"))
```
%% Cell type:markdown id: tags:
### Probabilistic evaluation
%% Cell type:markdown id: tags:
Define streamflow observations
%% Cell type:code id: tags:
``` python
``` R
# shape: {sites: 1, time: 5}
obs <- rbind(
c(4.7, 4.3, 5.5, 2.7, 4.1)
)
```
%% Cell type:markdown id: tags:
Define streamflow predictions
%% Cell type:code id: tags:
``` python
``` R
# shape: {sites: 1, lead times: 1, members: 3, time: 5}
prd <- array(
rbind(c(5.3, 4.2, 5.7, 2.3, 3.1),
c(4.3, 4.2, 4.7, 4.3, 3.3),
c(5.3, 5.2, 5.7, 2.3, 3.9)),
dim = c(1, 1, 3, 5)
)
```
%% Cell type:markdown id: tags:
Define streamflow thresholds
%% Cell type:code id: tags:
``` python
``` R
# shape: {sites: 1, thresholds: 2}
thr <- rbind(
c(4., 5.)
)
```
%% Cell type:markdown id: tags:
Compute Brier score
%% Cell type:code id: tags:
``` python
``` R
# shape: {sites: 1, lead times: 1, subsets: 1, samples: 1, thresholds: 2}
evalhyd::evalp(obs, prd, c("BS"), thr, events="high")
```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment