Skip to content

Commit 0b7e8d9

Browse files
committed
Clearing old files and adding proposal docs.
1 parent dd656e8 commit 0b7e8d9

File tree

7 files changed

+539
-873
lines changed

7 files changed

+539
-873
lines changed
171 KB
Binary file not shown.

Proposals/uncertainty/uncertainty.svg

Lines changed: 415 additions & 0 deletions
Loading
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "A New Neotoma Uncertainty Model"
3+
format: pdf
4+
---
5+
6+
# Adding Uncertainty to Neotoma
7+
8+
The use of uncertainty for measured values is critical. We need it directly associated with individual measurements, and we need to identify the type of uncertainty, and, potentially, the source of the uncertainty (methods of calculation, etc.). This means that for any uncertainty measurement we need to have a link to the sample and the variable that is being measured, we need to have some set of fixed uncertainty measures (standard deviations, standard errors), we also need to be able to freely define the source of the uncertainty (or perhaps again have a fixed set of measures). So, it should be possible to report the following:
9+
10+
| reference | value | units | uncertainty reported | source |
11+
|--------------------------------|-------|-------|----------------------|-----------------------------------------|
12+
| Pinus count for sample 1223445 | 12 | NISP | 1SD | Mahr Nomograms (cf. Maher Jr 1972) |
13+
| pH for sample 23244 | .02 | pH | 95% CI | Reported instrumental error from device |
14+
| NaOH for sample 23244 | .02 | ug | 95% CI | Reported instrumental error from device |
15+
16+
## Table modifications
17+
18+
The uncertainty must be linked with the `ndb.data.dataid` because it modifies the `ndb.data.value` for that variable & sample. If we can assume that the units for the uncertainty are equivalent to the units associated with the variable, however it is possible that uncertainty may be expressed as a percent value. Given this, we will create a new table that links the `ndb.data.dataid` primary key. This allows us to traverse the `ndb.variables` entry for the record (to retrieve the taxonomic information), and potentially link to the variable units if they are equivalent.
19+
20+
Given this data model:
21+
22+
* The table `ndb.data` remains as is.
23+
* The table `ndb.variables` remains as is.
24+
* We add a new table `ndb.datauncertainties` that uses fk(dataid) (the `fk(variableid)` is implied).
25+
* The table has columns `uncertaintyvalue`, `uncertaintyunit`, `uncertaintybasisid` and `notes` along with the standard `recdatecreated` and `recdatemodified`.
26+
27+
They will inherit information from the `ndb.variables` row, so the assumption is that the uncertainty is reported in the same units (and for the same taxon) as the `ndb.data.value`.
28+
29+
![Overall structure of the tables](uncertainty.svg)
30+
31+
### Example Table
32+
33+
| column | type | nulls | default | children | parents | comments |
34+
|---------------------|---------|-------|---------|----------|----------|------------|
35+
| dataid | integer | F | null | | ndb.data | fk(dataid) |
36+
| uncertaintyvalue | float | F | | | | | The value is required. |
37+
| uncertaintyunit | float | F | | | | | The value is required. |
38+
| uncertaintybasisid | integer | F | | | | ndb.uncertaintybases | |
39+
| notes | text | T | null | | | |
40+
41+
#### Proposed `ndb.uncertaintybasis.uncertaintybasis` values
42+
43+
Proposed values for uncertainty tables will come from standard reporting of uncertainty.
44+
45+
* 1 Standard Deviation
46+
* 2 Standard Deviations
47+
* 3 Standard Deviations
48+
* Mean square error
49+
50+
```SQL
51+
CREATE TABLE IF NOT EXISTS ndb.uncertaintybases (
52+
uncertaintybasisid SERIAL PRIMARY KEY,
53+
uncertaintybasis text,
54+
CONSTRAINT uniquebasis UNIQUE (uncertaintybasis))
55+
)
56+
INSERT INTO ndb.uncertaintybases (uncertaintybasis)
57+
VALUES ('1 Standard Deviation'),
58+
('2 Standard Deviations'),
59+
('3 Standard Deviation'),
60+
('1 Standard Error');
61+
```
62+
63+
### Proposed `ndb.datauncertainties` structure
64+
65+
| uncertaintybasisid | uncertaintybasis | . . . |
66+
67+
```SQL
68+
CREATE TABLE IF NOT EXISTS ndb.datauncertainties (
69+
dataid INTEGER REFERENCES ndb.data(dataid),
70+
uncertaintyvalue float,
71+
uncertaintyunitid integer REFERENCES ndb.variableunits(variableunitsid),
72+
uncertaintybasisid integer REFERENCES ndb.uncertaintybases(uncertaintybasisid),
73+
notes text,
74+
CONSTRAINT uniqueentryvalue UNIQUE (dataid, uncertaintyunitid, uncertaintybasisid)
75+
);
76+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Untitled"
3+
format: html
4+
---
5+
6+
# Adding Uncertainty to Neotoma
7+
8+
The use of uncertainty is critical. We need it directly associated with individual measurements, and we need to identify the type of uncertainty.
9+
10+
## Table modifications
11+
12+
The table `ndb.data` needs two new columns: `uncertaintyvalue` and `uncertaintytype`.
13+
14+
They will inherit information from the `ndb.variables` row, so the assumption is that the uncertainty is reported in the same units (and for the same taxon) as the `ndb.data.value`.
15+
16+
![Overall structure of the tables](uncertainty.svg)
17+
18+
### Proposed `ndb.data` structure:
19+
20+
| dataid | sampleid | variableid | value | uncertaintyvalue | uncertaintybasisid | . . . |
21+
22+
### Proposed `ndb.uncertaintybasis` structure:
23+
24+
| uncertaintybasisid | uncertaintybasis | . . . |
25+
26+
#### Proposed `ndb.uncertaintybasis.uncertaintybasis` values:
27+
28+
Proposed values for uncertainty tables will come from standard reporting of uncertainty.
29+
30+
* 1 Standard Deviation
31+
* 2 Standard Deviations
32+
* 3 Standard Deviations
33+
* Mean square error
34+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# New Steward Minting System
2+
3+
## Table `ti.stewards`
4+
5+
* stewardid - PRIMARY KEY
6+
* contactid - FOREIGN KEY
7+
* username - provided
8+
* pwd - Should be md5 hashed & autogenerated on minting with an email going out.
9+
* taxonomyexpert - Can the steward modify taxa?
10+
* **Expiration Date**
11+
* **Minted By**
12+
* recdatecreated - ALL NULL before 2021
13+
* recdatemodified - ALL NULL before 2021
14+

0 commit comments

Comments
 (0)