1 | |
---|
2 | #Require MMS; |
---|
3 | |
---|
4 | Real PutRandomSeed(2143); |
---|
5 | Serie s1 = SubSer(Gaussian(0, 1, C), y2001, y2002); |
---|
6 | Serie s2 = SubSer(Gaussian(0, 1, C), y2001, y2002); |
---|
7 | |
---|
8 | MMS::@DataSet dataSet = MMS::Container::ReplaceDataSet([[ |
---|
9 | Text _.name = "DataSet.Ej1" |
---|
10 | ]]); |
---|
11 | |
---|
12 | MMS::@Variable v1 = dataSet::CreateVariable([[ |
---|
13 | Text _.name = "Variable1"; |
---|
14 | Text _.type = "Serie"; |
---|
15 | Text _.expression = "Serie Copy(s1);" |
---|
16 | ]]); |
---|
17 | |
---|
18 | MMS::@Variable v2 = dataSet::CreateVariable([[ |
---|
19 | Text _.name = "Variable2"; |
---|
20 | Text _.type = "Serie"; |
---|
21 | Text _.expression = "Serie Copy(s2);" |
---|
22 | ]]); |
---|
23 | |
---|
24 | MMS::@Variable v3 = dataSet::CreateVariable([[ |
---|
25 | Text _.name = "Variable3"; |
---|
26 | Text _.type = "Serie"; |
---|
27 | Text _.expression = "Serie %1 * 2"; // tipo1 |
---|
28 | // Text _.expression = "Serie %1 * 0"; // tipo2 |
---|
29 | Set _.dependences = [[ "Variable2" ]] |
---|
30 | ]]); |
---|
31 | |
---|
32 | MMS::@Model model = MMS::Container::ReplaceModel([[ |
---|
33 | Text _.name = "Model.Ej1"; |
---|
34 | Set _.dataSets = [[ "DataSet.Ej1" ]] |
---|
35 | ]]); |
---|
36 | |
---|
37 | MMS::@Submodel submodel = model::CreateSubmodel([[ |
---|
38 | Text _.name = "Submodel"; |
---|
39 | NameBlock _.output = [[ |
---|
40 | Text _.name = "Output"; |
---|
41 | Text _.variable = "Variable1" |
---|
42 | ]]; |
---|
43 | NameBlock _.noise = [[ |
---|
44 | Text _.type = "Normal" |
---|
45 | ]] |
---|
46 | ]]); |
---|
47 | |
---|
48 | MMS::@ExpTerm expTerm1 = submodel::CreateExpTerm_TransferFunction([[ |
---|
49 | Text _.name = "ExpTerm1"; |
---|
50 | NameBlock _.input = [[ |
---|
51 | Text _.name = "Input1"; |
---|
52 | Text _.variable = "Variable2" |
---|
53 | ]]; |
---|
54 | Polyn _.transferFunction = 0.1 |
---|
55 | ]]); |
---|
56 | |
---|
57 | MMS::@ExpTerm expTerm2 = submodel::CreateExpTerm_TransferFunction([[ |
---|
58 | Text _.name = "ExpTerm2"; |
---|
59 | NameBlock _.input = [[ |
---|
60 | Text _.name = "Input2"; |
---|
61 | Text _.variable = "Variable3" |
---|
62 | ]]; |
---|
63 | Polyn _.transferFunction = 0.1 |
---|
64 | ]]); |
---|
65 | |
---|
66 | MMS::@Estimation estimation = MMS::Container::ReplaceEstimation([[ |
---|
67 | Text _.name = "Estimation.Ej1"; |
---|
68 | MMS::@Model _.model = model; |
---|
69 | MMS::@SettingsBSR _.settings = [[ |
---|
70 | // Se usa un valor bajo de 'mcmc.sampleLength' para agilizar pruebas |
---|
71 | Real mcmc.sampleLength = 200; |
---|
72 | Real do.report = True // False |
---|
73 | ]] |
---|
74 | ]]); |
---|
75 | |
---|
76 | ////////////////////////////////////////////////////////////////////////////// |
---|
77 | // Ejecución de la estimación: -> No es posible aplicar CholeskiFactor |
---|
78 | |
---|
79 | // Real estimation::Execute(?); |
---|
80 | |
---|
81 | ////////////////////////////////////////////////////////////////////////////// |
---|
82 | |
---|
83 | Set submodel::CheckMulticollinearity(?); |
---|
84 | //> Colinealidad: |
---|
85 | // (tipo1) |
---|
86 | // "Submodel__ExpTerm1__Linear.0" |
---|
87 | // "Submodel__ExpTerm2__Linear.0" |
---|
88 | // (tipo2) |
---|
89 | // "Submodel__ExpTerm2__Linear.0" |
---|
90 | |
---|
91 | ////////////////////////////////////////////////////////////////////////////// |
---|