JGCRI / matilda

A probabilistic framework for the Hector simple climate model
Other
5 stars 3 forks source link

Example of user defining own scoring criterion #38

Closed jk-brown closed 1 year ago

jk-brown commented 1 year ago

Currently, the vignette has the following as a code chunk to show an example of how to define your own criterion:

# Create a new criteria that can be used to screen Hector runs
my_criterion<- new_criterion(CONCENTRATIONS_CO2(), 
                    years = metricdata_co2$year, 
                    obs_values = metricdata_co2$co2_ppm)

my_criterion

That chunk won't run because I have the metricdata_co2 saved as internal data so it can't be accessed for examples etc. Would it be better to 1) don't run that code chunk 2) make metricdata_co2 available so it can be used in the vignette example? 3) just change this portion of the vignette to say something like "it is possible for the user to define their own criterion if observed data are obtained." and link to the new_criterion documentation? 4) Assign the internal data to an object and use it for the vignette example:

metricdata_co2 <- matilda:::metricdata_co2

my_criterion<- new_criterion(CONCENTRATIONS_CO2(), 
                    years = metricdata_co2$year, 
                    obs_values = metricdata_co2$co2_ppm)

my_criterion
bpbond commented 1 year ago

I'd vote to do something simpler!

my_criterion<- new_criterion(CONCENTRATIONS_CO2(), 
                    years = 1951:2000, 
                    obs_values = 301:350) # made-up time series

Or, given that our existing example already uses CO2, maybe something like

my_criterion<- new_criterion(GLOBAL_TAS(), 
                    years = 1951:2000, 
                    obs_values = seq(0.4, 1.0, length.out = 50) # made-up time series