@climateriskcommons/crc-framework 0.6.0 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,886 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://climateriskcommons.org/schemas/fitting/1.0",
4
+ "$defs": {
5
+ "samples_fit_specification": {
6
+ "type": "object",
7
+ "properties": {
8
+ "kind": {
9
+ "const": "samples"
10
+ },
11
+ "family": {
12
+ "enum": [
13
+ "genextreme",
14
+ "weibull_min",
15
+ "weibull_max",
16
+ "skewnorm",
17
+ "gumbel_r",
18
+ "gumbel_l",
19
+ "genpareto"
20
+ ]
21
+ },
22
+ "constraints": {
23
+ "anyOf": [
24
+ {
25
+ "type": "object",
26
+ "properties": {
27
+ "minimum_value": {
28
+ "anyOf": [
29
+ {
30
+ "type": "number",
31
+ "minimum": -1.7976931348623157e+308,
32
+ "maximum": 1.7976931348623157e+308
33
+ },
34
+ {
35
+ "type": "null"
36
+ }
37
+ ]
38
+ },
39
+ "maximum_value": {
40
+ "anyOf": [
41
+ {
42
+ "type": "number",
43
+ "minimum": -1.7976931348623157e+308,
44
+ "maximum": 1.7976931348623157e+308
45
+ },
46
+ {
47
+ "type": "null"
48
+ }
49
+ ]
50
+ },
51
+ "probability": {
52
+ "anyOf": [
53
+ {
54
+ "type": "number",
55
+ "minimum": 0,
56
+ "maximum": 1
57
+ },
58
+ {
59
+ "type": "null"
60
+ }
61
+ ]
62
+ },
63
+ "require_sample_support": {
64
+ "type": "boolean"
65
+ }
66
+ },
67
+ "required": [],
68
+ "additionalProperties": false
69
+ },
70
+ {
71
+ "type": "null"
72
+ }
73
+ ]
74
+ },
75
+ "estimator": {
76
+ "enum": [
77
+ "mle",
78
+ "lmoments"
79
+ ]
80
+ },
81
+ "minimum_samples": {
82
+ "type": "integer",
83
+ "minimum": 3
84
+ },
85
+ "fallbacks": {
86
+ "type": "array",
87
+ "items": {
88
+ "$ref": "#/$defs/samples_fit_specification"
89
+ }
90
+ }
91
+ },
92
+ "required": [
93
+ "kind",
94
+ "family"
95
+ ],
96
+ "additionalProperties": false
97
+ },
98
+ "quantiles_fit_specification": {
99
+ "type": "object",
100
+ "properties": {
101
+ "kind": {
102
+ "const": "quantiles"
103
+ },
104
+ "family": {
105
+ "enum": [
106
+ "genextreme",
107
+ "weibull_min",
108
+ "weibull_max",
109
+ "skewnorm",
110
+ "gumbel_r",
111
+ "gumbel_l",
112
+ "genpareto"
113
+ ]
114
+ },
115
+ "constraints": {
116
+ "anyOf": [
117
+ {
118
+ "type": "object",
119
+ "properties": {
120
+ "minimum_value": {
121
+ "anyOf": [
122
+ {
123
+ "type": "number",
124
+ "minimum": -1.7976931348623157e+308,
125
+ "maximum": 1.7976931348623157e+308
126
+ },
127
+ {
128
+ "type": "null"
129
+ }
130
+ ]
131
+ },
132
+ "maximum_value": {
133
+ "anyOf": [
134
+ {
135
+ "type": "number",
136
+ "minimum": -1.7976931348623157e+308,
137
+ "maximum": 1.7976931348623157e+308
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ]
143
+ },
144
+ "probability": {
145
+ "anyOf": [
146
+ {
147
+ "type": "number",
148
+ "minimum": 0,
149
+ "maximum": 1
150
+ },
151
+ {
152
+ "type": "null"
153
+ }
154
+ ]
155
+ },
156
+ "require_sample_support": {
157
+ "type": "boolean"
158
+ }
159
+ },
160
+ "required": [],
161
+ "additionalProperties": false
162
+ },
163
+ {
164
+ "type": "null"
165
+ }
166
+ ]
167
+ },
168
+ "weights": {
169
+ "anyOf": [
170
+ {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "number",
174
+ "minimum": 0,
175
+ "maximum": 1.7976931348623157e+308
176
+ },
177
+ "minItems": 1
178
+ },
179
+ {
180
+ "type": "null"
181
+ }
182
+ ]
183
+ },
184
+ "minimum_knots": {
185
+ "type": "integer",
186
+ "minimum": 4
187
+ }
188
+ },
189
+ "required": [
190
+ "kind",
191
+ "family"
192
+ ],
193
+ "additionalProperties": false
194
+ },
195
+ "censored_quantiles_fit_specification": {
196
+ "type": "object",
197
+ "properties": {
198
+ "kind": {
199
+ "const": "censored_quantiles"
200
+ },
201
+ "family": {
202
+ "enum": [
203
+ "genextreme",
204
+ "weibull_min",
205
+ "weibull_max",
206
+ "skewnorm",
207
+ "gumbel_r",
208
+ "gumbel_l",
209
+ "genpareto"
210
+ ]
211
+ },
212
+ "constraints": {
213
+ "anyOf": [
214
+ {
215
+ "type": "object",
216
+ "properties": {
217
+ "minimum_value": {
218
+ "anyOf": [
219
+ {
220
+ "type": "number",
221
+ "minimum": -1.7976931348623157e+308,
222
+ "maximum": 1.7976931348623157e+308
223
+ },
224
+ {
225
+ "type": "null"
226
+ }
227
+ ]
228
+ },
229
+ "maximum_value": {
230
+ "anyOf": [
231
+ {
232
+ "type": "number",
233
+ "minimum": -1.7976931348623157e+308,
234
+ "maximum": 1.7976931348623157e+308
235
+ },
236
+ {
237
+ "type": "null"
238
+ }
239
+ ]
240
+ },
241
+ "probability": {
242
+ "anyOf": [
243
+ {
244
+ "type": "number",
245
+ "minimum": 0,
246
+ "maximum": 1
247
+ },
248
+ {
249
+ "type": "null"
250
+ }
251
+ ]
252
+ },
253
+ "require_sample_support": {
254
+ "type": "boolean"
255
+ }
256
+ },
257
+ "required": [],
258
+ "additionalProperties": false
259
+ },
260
+ {
261
+ "type": "null"
262
+ }
263
+ ]
264
+ },
265
+ "censor_location": {
266
+ "type": "number",
267
+ "minimum": -1.7976931348623157e+308,
268
+ "maximum": 1.7976931348623157e+308
269
+ },
270
+ "residual_scale_floor_ratio": {
271
+ "type": "number",
272
+ "minimum": -1.7976931348623157e+308,
273
+ "maximum": 1.7976931348623157e+308,
274
+ "exclusiveMinimum": 0
275
+ },
276
+ "minimum_knots": {
277
+ "type": "integer",
278
+ "minimum": 4
279
+ }
280
+ },
281
+ "required": [
282
+ "kind",
283
+ "family",
284
+ "censor_location"
285
+ ],
286
+ "additionalProperties": false
287
+ },
288
+ "hurdle_quantiles_fit_specification": {
289
+ "type": "object",
290
+ "properties": {
291
+ "kind": {
292
+ "const": "hurdle_quantiles"
293
+ },
294
+ "family": {
295
+ "enum": [
296
+ "genextreme",
297
+ "weibull_min",
298
+ "weibull_max",
299
+ "skewnorm",
300
+ "gumbel_r",
301
+ "gumbel_l",
302
+ "genpareto"
303
+ ]
304
+ },
305
+ "constraints": {
306
+ "anyOf": [
307
+ {
308
+ "type": "object",
309
+ "properties": {
310
+ "minimum_value": {
311
+ "anyOf": [
312
+ {
313
+ "type": "number",
314
+ "minimum": -1.7976931348623157e+308,
315
+ "maximum": 1.7976931348623157e+308
316
+ },
317
+ {
318
+ "type": "null"
319
+ }
320
+ ]
321
+ },
322
+ "maximum_value": {
323
+ "anyOf": [
324
+ {
325
+ "type": "number",
326
+ "minimum": -1.7976931348623157e+308,
327
+ "maximum": 1.7976931348623157e+308
328
+ },
329
+ {
330
+ "type": "null"
331
+ }
332
+ ]
333
+ },
334
+ "probability": {
335
+ "anyOf": [
336
+ {
337
+ "type": "number",
338
+ "minimum": 0,
339
+ "maximum": 1
340
+ },
341
+ {
342
+ "type": "null"
343
+ }
344
+ ]
345
+ },
346
+ "require_sample_support": {
347
+ "type": "boolean"
348
+ }
349
+ },
350
+ "required": [],
351
+ "additionalProperties": false
352
+ },
353
+ {
354
+ "type": "null"
355
+ }
356
+ ]
357
+ },
358
+ "atom_probability": {
359
+ "type": "number",
360
+ "minimum": 0,
361
+ "maximum": 1,
362
+ "exclusiveMinimum": 0,
363
+ "exclusiveMaximum": 1
364
+ },
365
+ "atom_location": {
366
+ "type": "number",
367
+ "minimum": -1.7976931348623157e+308,
368
+ "maximum": 1.7976931348623157e+308
369
+ },
370
+ "minimum_knots": {
371
+ "type": "integer",
372
+ "minimum": 4
373
+ }
374
+ },
375
+ "required": [
376
+ "kind",
377
+ "family",
378
+ "atom_probability"
379
+ ],
380
+ "additionalProperties": false
381
+ },
382
+ "concrete_specification": {
383
+ "oneOf": [
384
+ {
385
+ "$ref": "#/$defs/samples_fit_specification"
386
+ },
387
+ {
388
+ "$ref": "#/$defs/quantiles_fit_specification"
389
+ },
390
+ {
391
+ "$ref": "#/$defs/censored_quantiles_fit_specification"
392
+ },
393
+ {
394
+ "$ref": "#/$defs/hurdle_quantiles_fit_specification"
395
+ }
396
+ ]
397
+ },
398
+ "model_selection": {
399
+ "type": "object",
400
+ "properties": {
401
+ "kind": {
402
+ "const": "model_selection"
403
+ },
404
+ "candidates": {
405
+ "type": "array",
406
+ "items": {
407
+ "$ref": "#/$defs/concrete_specification"
408
+ },
409
+ "minItems": 1
410
+ },
411
+ "criterion": {
412
+ "enum": [
413
+ "ks",
414
+ "normalized_rmse"
415
+ ]
416
+ }
417
+ },
418
+ "required": [
419
+ "kind",
420
+ "candidates"
421
+ ],
422
+ "additionalProperties": false
423
+ },
424
+ "specification": {
425
+ "oneOf": [
426
+ {
427
+ "$ref": "#/$defs/concrete_specification"
428
+ },
429
+ {
430
+ "$ref": "#/$defs/model_selection"
431
+ }
432
+ ]
433
+ }
434
+ },
435
+ "type": "object",
436
+ "properties": {
437
+ "specification": {
438
+ "$ref": "#/$defs/specification"
439
+ },
440
+ "attempts": {
441
+ "type": "array",
442
+ "items": {
443
+ "oneOf": [
444
+ {
445
+ "type": "object",
446
+ "properties": {
447
+ "specification": {
448
+ "$ref": "#/$defs/samples_fit_specification"
449
+ },
450
+ "status": {
451
+ "const": "converged"
452
+ },
453
+ "diagnostic": {
454
+ "type": "object",
455
+ "properties": {
456
+ "ks_statistic": {
457
+ "type": "number",
458
+ "minimum": 0,
459
+ "maximum": 1
460
+ },
461
+ "ks_pvalue": {
462
+ "type": "number",
463
+ "minimum": 0,
464
+ "maximum": 1
465
+ },
466
+ "rmse": {
467
+ "type": "number",
468
+ "minimum": 0,
469
+ "maximum": 1.7976931348623157e+308
470
+ },
471
+ "r_squared": {
472
+ "type": "number",
473
+ "minimum": -1.7976931348623157e+308,
474
+ "maximum": 1.7976931348623157e+308
475
+ },
476
+ "iterations": {
477
+ "type": "integer",
478
+ "minimum": 0
479
+ },
480
+ "evaluations": {
481
+ "type": "integer",
482
+ "minimum": 0
483
+ }
484
+ },
485
+ "required": [
486
+ "ks_statistic",
487
+ "ks_pvalue",
488
+ "rmse",
489
+ "r_squared",
490
+ "iterations",
491
+ "evaluations"
492
+ ],
493
+ "additionalProperties": false
494
+ }
495
+ },
496
+ "required": [
497
+ "specification",
498
+ "status",
499
+ "diagnostic"
500
+ ],
501
+ "additionalProperties": false
502
+ },
503
+ {
504
+ "type": "object",
505
+ "properties": {
506
+ "specification": {
507
+ "$ref": "#/$defs/quantiles_fit_specification"
508
+ },
509
+ "status": {
510
+ "const": "converged"
511
+ },
512
+ "diagnostic": {
513
+ "type": "object",
514
+ "properties": {
515
+ "rmse": {
516
+ "type": "number",
517
+ "minimum": 0,
518
+ "maximum": 1.7976931348623157e+308
519
+ },
520
+ "weighted_r_squared": {
521
+ "type": "number",
522
+ "minimum": -1.7976931348623157e+308,
523
+ "maximum": 1.7976931348623157e+308
524
+ },
525
+ "maximum_absolute_residual": {
526
+ "type": "number",
527
+ "minimum": 0,
528
+ "maximum": 1.7976931348623157e+308
529
+ },
530
+ "normalized_rmse": {
531
+ "type": "number",
532
+ "minimum": 0,
533
+ "maximum": 1.7976931348623157e+308
534
+ },
535
+ "normalization_scale": {
536
+ "type": "number",
537
+ "minimum": 0,
538
+ "maximum": 1.7976931348623157e+308,
539
+ "exclusiveMinimum": 0
540
+ },
541
+ "iterations": {
542
+ "type": "integer",
543
+ "minimum": 0
544
+ },
545
+ "evaluations": {
546
+ "type": "integer",
547
+ "minimum": 0
548
+ }
549
+ },
550
+ "required": [
551
+ "rmse",
552
+ "weighted_r_squared",
553
+ "maximum_absolute_residual",
554
+ "normalized_rmse",
555
+ "normalization_scale",
556
+ "iterations",
557
+ "evaluations"
558
+ ],
559
+ "additionalProperties": false
560
+ }
561
+ },
562
+ "required": [
563
+ "specification",
564
+ "status",
565
+ "diagnostic"
566
+ ],
567
+ "additionalProperties": false
568
+ },
569
+ {
570
+ "type": "object",
571
+ "properties": {
572
+ "specification": {
573
+ "$ref": "#/$defs/censored_quantiles_fit_specification"
574
+ },
575
+ "status": {
576
+ "const": "converged"
577
+ },
578
+ "diagnostic": {
579
+ "type": "object",
580
+ "properties": {
581
+ "rmse": {
582
+ "type": "number",
583
+ "minimum": 0,
584
+ "maximum": 1.7976931348623157e+308
585
+ },
586
+ "weighted_r_squared": {
587
+ "type": "number",
588
+ "minimum": -1.7976931348623157e+308,
589
+ "maximum": 1.7976931348623157e+308
590
+ },
591
+ "maximum_absolute_residual": {
592
+ "type": "number",
593
+ "minimum": 0,
594
+ "maximum": 1.7976931348623157e+308
595
+ },
596
+ "normalized_rmse": {
597
+ "type": "number",
598
+ "minimum": 0,
599
+ "maximum": 1.7976931348623157e+308
600
+ },
601
+ "normalization_scale": {
602
+ "type": "number",
603
+ "minimum": 0,
604
+ "maximum": 1.7976931348623157e+308,
605
+ "exclusiveMinimum": 0
606
+ },
607
+ "negative_log_likelihood": {
608
+ "type": "number",
609
+ "minimum": -1.7976931348623157e+308,
610
+ "maximum": 1.7976931348623157e+308
611
+ },
612
+ "residual_scale": {
613
+ "type": "number",
614
+ "minimum": 0,
615
+ "maximum": 1.7976931348623157e+308,
616
+ "exclusiveMinimum": 0
617
+ },
618
+ "residual_scale_floor": {
619
+ "type": "number",
620
+ "minimum": 0,
621
+ "maximum": 1.7976931348623157e+308,
622
+ "exclusiveMinimum": 0
623
+ },
624
+ "censored_count": {
625
+ "type": "integer",
626
+ "minimum": 0
627
+ },
628
+ "uncensored_count": {
629
+ "type": "integer",
630
+ "minimum": 0
631
+ },
632
+ "iterations": {
633
+ "type": "integer",
634
+ "minimum": 0
635
+ },
636
+ "evaluations": {
637
+ "type": "integer",
638
+ "minimum": 0
639
+ }
640
+ },
641
+ "required": [
642
+ "rmse",
643
+ "weighted_r_squared",
644
+ "maximum_absolute_residual",
645
+ "normalized_rmse",
646
+ "normalization_scale",
647
+ "negative_log_likelihood",
648
+ "residual_scale",
649
+ "residual_scale_floor",
650
+ "censored_count",
651
+ "uncensored_count",
652
+ "iterations",
653
+ "evaluations"
654
+ ],
655
+ "additionalProperties": false
656
+ }
657
+ },
658
+ "required": [
659
+ "specification",
660
+ "status",
661
+ "diagnostic"
662
+ ],
663
+ "additionalProperties": false
664
+ },
665
+ {
666
+ "type": "object",
667
+ "properties": {
668
+ "specification": {
669
+ "$ref": "#/$defs/hurdle_quantiles_fit_specification"
670
+ },
671
+ "status": {
672
+ "const": "converged"
673
+ },
674
+ "diagnostic": {
675
+ "type": "object",
676
+ "properties": {
677
+ "normalized_rmse": {
678
+ "type": "number",
679
+ "minimum": 0,
680
+ "maximum": 1.7976931348623157e+308
681
+ },
682
+ "normalization_scale": {
683
+ "type": "number",
684
+ "minimum": 0,
685
+ "maximum": 1.7976931348623157e+308,
686
+ "exclusiveMinimum": 0
687
+ },
688
+ "tail_rmse": {
689
+ "type": "number",
690
+ "minimum": 0,
691
+ "maximum": 1.7976931348623157e+308
692
+ },
693
+ "tail_weighted_r_squared": {
694
+ "type": "number",
695
+ "minimum": -1.7976931348623157e+308,
696
+ "maximum": 1.7976931348623157e+308
697
+ },
698
+ "tail_maximum_absolute_residual": {
699
+ "type": "number",
700
+ "minimum": 0,
701
+ "maximum": 1.7976931348623157e+308
702
+ },
703
+ "atom_count": {
704
+ "type": "integer",
705
+ "minimum": 0
706
+ },
707
+ "tail_count": {
708
+ "type": "integer",
709
+ "minimum": 0
710
+ },
711
+ "iterations": {
712
+ "type": "integer",
713
+ "minimum": 0
714
+ },
715
+ "evaluations": {
716
+ "type": "integer",
717
+ "minimum": 0
718
+ }
719
+ },
720
+ "required": [
721
+ "normalized_rmse",
722
+ "normalization_scale",
723
+ "tail_rmse",
724
+ "tail_weighted_r_squared",
725
+ "tail_maximum_absolute_residual",
726
+ "atom_count",
727
+ "tail_count",
728
+ "iterations",
729
+ "evaluations"
730
+ ],
731
+ "additionalProperties": false
732
+ }
733
+ },
734
+ "required": [
735
+ "specification",
736
+ "status",
737
+ "diagnostic"
738
+ ],
739
+ "additionalProperties": false
740
+ },
741
+ {
742
+ "type": "object",
743
+ "properties": {
744
+ "specification": {
745
+ "$ref": "#/$defs/concrete_specification"
746
+ },
747
+ "status": {
748
+ "enum": [
749
+ "rejected",
750
+ "failed"
751
+ ]
752
+ },
753
+ "diagnostic": {
754
+ "type": "object",
755
+ "properties": {
756
+ "message": {
757
+ "type": "string",
758
+ "minLength": 1
759
+ }
760
+ },
761
+ "required": [
762
+ "message"
763
+ ],
764
+ "additionalProperties": false
765
+ }
766
+ },
767
+ "required": [
768
+ "specification",
769
+ "status",
770
+ "diagnostic"
771
+ ],
772
+ "additionalProperties": false
773
+ }
774
+ ]
775
+ },
776
+ "minItems": 1
777
+ },
778
+ "selected_attempt": {
779
+ "anyOf": [
780
+ {
781
+ "type": "integer",
782
+ "minimum": 0
783
+ },
784
+ {
785
+ "type": "null"
786
+ }
787
+ ]
788
+ },
789
+ "estimator": {
790
+ "anyOf": [
791
+ {
792
+ "enum": [
793
+ "mle",
794
+ "lmoments"
795
+ ]
796
+ },
797
+ {
798
+ "type": "null"
799
+ }
800
+ ]
801
+ },
802
+ "converged": {
803
+ "type": "boolean"
804
+ },
805
+ "evidence_count": {
806
+ "type": "integer",
807
+ "minimum": 0
808
+ },
809
+ "used_count": {
810
+ "type": "integer",
811
+ "minimum": 0
812
+ },
813
+ "excluded_count": {
814
+ "type": "integer",
815
+ "minimum": 0
816
+ },
817
+ "weights": {
818
+ "anyOf": [
819
+ {
820
+ "type": "array",
821
+ "items": {
822
+ "type": "number",
823
+ "minimum": 0,
824
+ "maximum": 1
825
+ }
826
+ },
827
+ {
828
+ "type": "null"
829
+ }
830
+ ]
831
+ },
832
+ "value_interval": {
833
+ "anyOf": [
834
+ {
835
+ "type": "array",
836
+ "items": {
837
+ "type": "number",
838
+ "minimum": -1.7976931348623157e+308,
839
+ "maximum": 1.7976931348623157e+308
840
+ },
841
+ "minItems": 2,
842
+ "maxItems": 2
843
+ },
844
+ {
845
+ "type": "null"
846
+ }
847
+ ]
848
+ },
849
+ "probability_interval": {
850
+ "anyOf": [
851
+ {
852
+ "type": "array",
853
+ "items": {
854
+ "type": "number",
855
+ "minimum": 0,
856
+ "maximum": 1
857
+ },
858
+ "minItems": 2,
859
+ "maxItems": 2
860
+ },
861
+ {
862
+ "type": "null"
863
+ }
864
+ ]
865
+ },
866
+ "engine_version": {
867
+ "type": "string",
868
+ "minLength": 1
869
+ }
870
+ },
871
+ "required": [
872
+ "specification",
873
+ "attempts",
874
+ "selected_attempt",
875
+ "estimator",
876
+ "converged",
877
+ "evidence_count",
878
+ "used_count",
879
+ "excluded_count",
880
+ "weights",
881
+ "value_interval",
882
+ "probability_interval",
883
+ "engine_version"
884
+ ],
885
+ "additionalProperties": false
886
+ }