4 | | * '''BASE ''' |
5 | | * '''OZA''' |
6 | | * '''SUMMURY ''' |
7 | | * '''PARAMETERS ''' |
8 | | * '''RESULTS ''' |
| 4 | creación de un catalogo de modules |
| 5 | {{{ |
| 6 | create table mms_d_module ( |
| 7 | --//////////////////////////////////////////////////////////////////////////// |
| 8 | co_module varchar unique not null, |
| 9 | nu_version integer not null |
| 10 | ); |
| 11 | }}} |
| 12 | === BASE === |
| 13 | es el modulo imprecindible para los demas siguientes donde se difine las caracteristicas |
| 14 | del objeto guardad0 |
| 15 | |
| 16 | ==== Script de tablas BASE.1 ==== |
| 17 | |
| 18 | {{{ |
| 19 | |
| 20 | insert into mms_d_module |
| 21 | values ('BASE', 1); |
| 22 | |
| 23 | -- drop table mms_d_object; |
| 24 | --//////////////////////////////////////////////////////////////////////////// |
| 25 | create table mms_d_object ( |
| 26 | --//////////////////////////////////////////////////////////////////////////// |
| 27 | id_object serial unique not null, |
| 28 | co_subclass varchar not null, |
| 29 | co_name varchar not null, |
| 30 | co_version varchar not null, |
| 31 | ds_object varchar, |
| 32 | ds_tags varchar, |
| 33 | dt_creation timestamp not null, |
| 34 | dt_modification timestamp not null, |
| 35 | |
| 36 | constraint PK01_mms_d_object |
| 37 | primary key (id_object), |
| 38 | |
| 39 | constraint PK02_mms_d_object |
| 40 | unique (co_subclass, co_name, co_version)); |
| 41 | }}} |
| 42 | |
| 43 | |
| 44 | === OZA === |
| 45 | es el modulo del guardado de specificación del objeto ''objeto.oza'' |
| 46 | |
| 47 | ==== Script de tablas OZA.1 ==== |
| 48 | |
| 49 | {{{ |
| 50 | |
| 51 | insert into mms_d_module |
| 52 | values ('OZA', 1); |
| 53 | |
| 54 | -- drop table mms_d_object_oza; |
| 55 | --//////////////////////////////////////////////////////////////////////////// |
| 56 | create table mms_d_object_oza ( |
| 57 | --//////////////////////////////////////////////////////////////////////////// |
| 58 | id_object integer not null, |
| 59 | ob_oza varchar not null, |
| 60 | |
| 61 | constraint PK01_mms_d_object_oza |
| 62 | primary key (id_object), |
| 63 | |
| 64 | constraint FK01_mms_d_object_oza |
| 65 | foreign key (id_object) references mms_d_object(id_object) |
| 66 | ); |
| 67 | }}} |
| 68 | |
| 69 | === SUMMURY === |
| 70 | es el modulo del resumen de especificacones del objeto ''objeto.sne'' |
| 71 | |
| 72 | ==== Script de tablas SUMMURY.1 ==== |
| 73 | |
| 74 | {{{ |
| 75 | insert into mms_d_module |
| 76 | values ('SUMMARY', 1); |
| 77 | |
| 78 | -- drop table mms_d_object_summary; |
| 79 | --//////////////////////////////////////////////////////////////////////////// |
| 80 | create table mms_d_object_summary ( |
| 81 | --//////////////////////////////////////////////////////////////////////////// |
| 82 | id_object integer not null, |
| 83 | co_section varchar not null, |
| 84 | co_name varchar not null, |
| 85 | co_grammar varchar not null, |
| 86 | co_value varchar not null, |
| 87 | |
| 88 | constraint PK01_mms_d_object_summary |
| 89 | primary key (id_object, co_section, co_name), |
| 90 | |
| 91 | constraint FK01_mms_d_object_summary |
| 92 | foreign key (id_object) references mms_d_object(id_object) |
| 93 | ); |
| 94 | }}} |
| 95 | |
| 96 | === PARAMETERS === |
| 97 | es el modulo del guardato de resultado de parametros estimados |
| 98 | |
| 99 | ==== Script de tablas PARAMETERS.1 ==== |
| 100 | |
| 101 | {{{ |
| 102 | insert into mms_d_module |
| 103 | values ('PARAMETERS', 1); |
| 104 | |
| 105 | -- drop table mms_f_parameter_results; |
| 106 | --//////////////////////////////////////////////////////////////////////////// |
| 107 | create table mms_f_parameter_results ( |
| 108 | --//////////////////////////////////////////////////////////////////////////// |
| 109 | id_object integer not null, |
| 110 | co_parameter varchar not null, |
| 111 | co_node varchar not null, |
| 112 | co_term varchar, |
| 113 | co_type varchar not null, |
| 114 | nu_block integer, -- period, category, piece |
| 115 | nu_degree integer, |
| 116 | -- definition |
| 117 | vl_initial numeric, |
| 118 | vl_is_fixed numeric, |
| 119 | vl_prior_mean numeric, |
| 120 | vl_prior_sigma numeric, |
| 121 | vl_cns_minimum numeric, |
| 122 | vl_cns_maximum numeric, |
| 123 | -- results |
| 124 | vl_mean numeric, |
| 125 | vl_sigma numeric, |
| 126 | vl_minimum numeric, |
| 127 | vl_maximum numeric, |
| 128 | vl_median numeric, |
| 129 | |
| 130 | constraint PK01_mms_f_parameter_results |
| 131 | primary key (id_object, co_parameter), |
| 132 | |
| 133 | constraint FK01_mms_f_parameter_results |
| 134 | foreign key (id_object) references mms_d_object(id_object) |
| 135 | ); |
| 136 | }}} |
| 137 | |
| 138 | |
| 139 | === RESULTS === |
| 140 | es el modulo del guardato de resultado de submodelos estimados |
| 141 | |
| 142 | |
| 143 | |
| 144 | ==== Script de tablas RESULTS.1 ==== |
| 145 | |
| 146 | {{{ |
| 147 | insert into mms_d_module |
| 148 | values ('RESULTS', 1); |
| 149 | |
| 150 | -- drop table mms_d_submodel_results; |
| 151 | --//////////////////////////////////////////////////////////////////////////// |
| 152 | create table mms_d_submodel_results ( |
| 153 | --//////////////////////////////////////////////////////////////////////////// |
| 154 | id_object integer not null, |
| 155 | co_submodel varchar not null, |
| 156 | co_type varchar not null, |
| 157 | co_function varchar, -- link o transformation LOG PROBIT |
| 158 | co_arima_label varchar, -- P1DIF1AR1MA1 |
| 159 | vl_data_size numeric, |
| 160 | vl_parameters_size numeric, |
| 161 | vl_log_likelihood numeric, |
| 162 | |
| 163 | constraint PK01_mms_d_submodel_results |
| 164 | primary key (id_object, co_submodel), |
| 165 | |
| 166 | constraint FK01_mms_d_submodel_results |
| 167 | foreign key (id_object) references mms_d_object(id_object) ); |
| 168 | |
| 169 | -- drop table mms_f_submodel_statistic; |
| 170 | --//////////////////////////////////////////////////////////////////////////// |
| 171 | create table mms_f_submodel_results_statistic ( |
| 172 | --//////////////////////////////////////////////////////////////////////////// |
| 173 | id_object integer not null, |
| 174 | co_submodel varchar not null, |
| 175 | co_statistic varchar not null, |
| 176 | vl_statistic numeric not null, |
| 177 | |
| 178 | constraint PK01_mms_f_submodel_results_statistic |
| 179 | primary key (id_object, co_submodel, co_statistic), |
| 180 | |
| 181 | constraint FK01_mms_f_submodel_results_statistic |
| 182 | foreign key (id_object) references mms_d_object(id_object) |
| 183 | ); |
| 184 | |
| 185 | -- drop table mms_f_submodel_c_results_series; |
| 186 | --//////////////////////////////////////////////////////////////////////////// |
| 187 | create table mms_f_submodel_c_results_series ( |
| 188 | --//////////////////////////////////////////////////////////////////////////// |
| 189 | id_object integer not null, |
| 190 | co_submodel varchar, |
| 191 | dt_series timestamp, |
| 192 | vl_observations numeric, |
| 193 | vl_output numeric, |
| 194 | vl_interruptions numeric, |
| 195 | vl_additive_filter numeric, |
| 196 | vl_filter numeric, |
| 197 | vl_noise numeric, |
| 198 | vl_dif_noise numeric, |
| 199 | vl_residuals numeric, |
| 200 | vl_std_residuals numeric, |
| 201 | vl_prediction numeric, |
| 202 | vl_obs_prediction numeric, |
| 203 | |
| 204 | constraint PK01_mms_f_submodel_results_series |
| 205 | primary key (id_object, co_submodel, dt_series), |
| 206 | |
| 207 | constraint FK01_mms_f_submodel_results_series |
| 208 | foreign key (id_object) references mms_d_object(id_object)); |
| 209 | |
| 210 | -- drop table mms_f_submodel_d_results_matrix; |
| 211 | --//////////////////////////////////////////////////////////////////////////// |
| 212 | create table mms_f_submodel_d_results_matrix ( |
| 213 | --//////////////////////////////////////////////////////////////////////////// |
| 214 | id_object integer not null, |
| 215 | co_submodel varchar, |
| 216 | nu_row integer, |
| 217 | vl_output numeric, |
| 218 | vl_filter numeric, |
| 219 | vl_residuals numeric, |
| 220 | vl_prediction numeric, |
| 221 | |
| 222 | constraint PK01_mms_f_submodel_d_results_matrix |
| 223 | primary key (id_object, co_submodel, nu_row), |
| 224 | |
| 225 | constraint FK01_mms_f_submodel_d_results_matrix |
| 226 | foreign key (id_object) references mms_d_object(id_object) |
| 227 | ); |
| 228 | }}} |
| 229 | |
| 230 | == Metodos == |
| 231 | |
| 232 | Todos los metodos de repositorio Folder son aplicable a repositorio Data Base |