mixRHLP: Simultaneous model-based clustering and segmentation of heterogeneous and dynamical functional data (curves/times series) with smooth and/or abrupt changes in regime by a mixture of regression models with hidden logistic processes, fitted by the EM algorithm and extensions.
It was written in R Markdown, using the knitr package for production.
See help(package="flamingos")
for further details and
references provided by citation("flamingos")
.
mixrhlp <- emMixRHLP(X = x, Y = Y, K, R, p, q, variance_type, init_kmeans,
n_tries, max_iter, threshold, verbose, verbose_IRLS)
## EM - mixRHLP: Iteration: 1 | log-likelihood: -18129.8169520025
## EM - mixRHLP: Iteration: 2 | log-likelihood: -16642.7322674631
## EM - mixRHLP: Iteration: 3 | log-likelihood: -16496.947898833
## EM - mixRHLP: Iteration: 4 | log-likelihood: -16391.6755568235
## EM - mixRHLP: Iteration: 5 | log-likelihood: -16308.151649539
## EM - mixRHLP: Iteration: 6 | log-likelihood: -16242.6749975019
## EM - mixRHLP: Iteration: 7 | log-likelihood: -16187.9951484578
## EM - mixRHLP: Iteration: 8 | log-likelihood: -16138.360050325
## EM - mixRHLP: Iteration: 9 | log-likelihood: -16092.9430959116
## EM - mixRHLP: Iteration: 10 | log-likelihood: -16053.588838999
## EM - mixRHLP: Iteration: 11 | log-likelihood: -16020.7365667916
## EM - mixRHLP: Iteration: 12 | log-likelihood: -15993.7513179937
## EM - mixRHLP: Iteration: 13 | log-likelihood: -15972.7088032469
## EM - mixRHLP: Iteration: 14 | log-likelihood: -15957.3889127412
## EM - mixRHLP: Iteration: 15 | log-likelihood: -15946.5663566082
## EM - mixRHLP: Iteration: 16 | log-likelihood: -15938.693534838
## EM - mixRHLP: Iteration: 17 | log-likelihood: -15932.584112949
## EM - mixRHLP: Iteration: 18 | log-likelihood: -15927.5299507605
## EM - mixRHLP: Iteration: 19 | log-likelihood: -15923.1499635319
## EM - mixRHLP: Iteration: 20 | log-likelihood: -15919.2392546398
## EM - mixRHLP: Iteration: 21 | log-likelihood: -15915.6795793534
## EM - mixRHLP: Iteration: 22 | log-likelihood: -15912.3944381959
## EM - mixRHLP: Iteration: 23 | log-likelihood: -15909.327585346
## EM - mixRHLP: Iteration: 24 | log-likelihood: -15906.4326405988
## EM - mixRHLP: Iteration: 25 | log-likelihood: -15903.6678636145
## EM - mixRHLP: Iteration: 26 | log-likelihood: -15900.9933370165
## EM - mixRHLP: Iteration: 27 | log-likelihood: -15898.3692402859
## EM - mixRHLP: Iteration: 28 | log-likelihood: -15895.7545341827
## EM - mixRHLP: Iteration: 29 | log-likelihood: -15893.1056775994
## EM - mixRHLP: Iteration: 30 | log-likelihood: -15890.3751610539
## EM - mixRHLP: Iteration: 31 | log-likelihood: -15887.5097378815
## EM - mixRHLP: Iteration: 32 | log-likelihood: -15884.4482946475
## EM - mixRHLP: Iteration: 33 | log-likelihood: -15881.1193453446
## EM - mixRHLP: Iteration: 34 | log-likelihood: -15877.4381561225
## EM - mixRHLP: Iteration: 35 | log-likelihood: -15873.3037170772
## EM - mixRHLP: Iteration: 36 | log-likelihood: -15868.5956607911
## EM - mixRHLP: Iteration: 37 | log-likelihood: -15863.171868441
## EM - mixRHLP: Iteration: 38 | log-likelihood: -15856.8678694783
## EM - mixRHLP: Iteration: 39 | log-likelihood: -15849.500250046
## EM - mixRHLP: Iteration: 40 | log-likelihood: -15840.8778843568
## EM - mixRHLP: Iteration: 41 | log-likelihood: -15830.8267303162
## EM - mixRHLP: Iteration: 42 | log-likelihood: -15819.2343887404
## EM - mixRHLP: Iteration: 43 | log-likelihood: -15806.1142558301
## EM - mixRHLP: Iteration: 44 | log-likelihood: -15791.6651550126
## EM - mixRHLP: Iteration: 45 | log-likelihood: -15776.2575311117
## EM - mixRHLP: Iteration: 46 | log-likelihood: -15760.2525673176
## EM - mixRHLP: Iteration: 47 | log-likelihood: -15743.6600428387
## EM - mixRHLP: Iteration: 48 | log-likelihood: -15725.849472721
## EM - mixRHLP: Iteration: 49 | log-likelihood: -15705.5392028324
## EM - mixRHLP: Iteration: 50 | log-likelihood: -15681.0330055802
## EM - mixRHLP: Iteration: 51 | log-likelihood: -15650.7058006773
## EM - mixRHLP: Iteration: 52 | log-likelihood: -15614.1891628979
## EM - mixRHLP: Iteration: 53 | log-likelihood: -15574.3209962236
## EM - mixRHLP: Iteration: 54 | log-likelihood: -15536.9561042096
## EM - mixRHLP: Iteration: 55 | log-likelihood: -15505.9888676547
## EM - mixRHLP: Iteration: 56 | log-likelihood: -15480.347974787
## EM - mixRHLP: Iteration: 57 | log-likelihood: -15456.7432033068
## EM - mixRHLP: Iteration: 58 | log-likelihood: -15432.8558943472
## EM - mixRHLP: Iteration: 59 | log-likelihood: -15408.4123139154
## EM - mixRHLP: Iteration: 60 | log-likelihood: -15384.7708355235
## EM - mixRHLP: Iteration: 61 | log-likelihood: -15363.3704926308
## EM - mixRHLP: Iteration: 62 | log-likelihood: -15344.3247788469
## EM - mixRHLP: Iteration: 63 | log-likelihood: -15326.4442007931
## EM - mixRHLP: Iteration: 64 | log-likelihood: -15308.1502066518
## EM - mixRHLP: Iteration: 65 | log-likelihood: -15288.36506617
## EM - mixRHLP: Iteration: 66 | log-likelihood: -15267.1380314859
## EM - mixRHLP: Iteration: 67 | log-likelihood: -15245.8151021309
## EM - mixRHLP: Iteration: 68 | log-likelihood: -15226.300764964
## EM - mixRHLP: Iteration: 69 | log-likelihood: -15209.9671868433
## EM - mixRHLP: Iteration: 70 | log-likelihood: -15197.3697193674
## EM - mixRHLP: Iteration: 71 | log-likelihood: -15187.8845852548
## EM - mixRHLP: Iteration: 72 | log-likelihood: -15180.4065779427
## EM - mixRHLP: Iteration: 73 | log-likelihood: -15174.1897193241
## EM - mixRHLP: Iteration: 74 | log-likelihood: -15168.8680084097
## EM - mixRHLP: Iteration: 75 | log-likelihood: -15164.161562744
## EM - mixRHLP: Iteration: 76 | log-likelihood: -15159.6679572487
## EM - mixRHLP: Iteration: 77 | log-likelihood: -15155.1488045683
## EM - mixRHLP: Iteration: 78 | log-likelihood: -15150.9231858143
## EM - mixRHLP: Iteration: 79 | log-likelihood: -15147.221216819
## EM - mixRHLP: Iteration: 80 | log-likelihood: -15144.0789426588
## EM - mixRHLP: Iteration: 81 | log-likelihood: -15141.3516305635
## EM - mixRHLP: Iteration: 82 | log-likelihood: -15138.8602529876
## EM - mixRHLP: Iteration: 83 | log-likelihood: -15136.5059345662
## EM - mixRHLP: Iteration: 84 | log-likelihood: -15134.2384537766
## EM - mixRHLP: Iteration: 85 | log-likelihood: -15132.0298589309
## EM - mixRHLP: Iteration: 86 | log-likelihood: -15129.8608706576
## EM - mixRHLP: Iteration: 87 | log-likelihood: -15127.7157936566
## EM - mixRHLP: Iteration: 88 | log-likelihood: -15125.5797196054
## EM - mixRHLP: Iteration: 89 | log-likelihood: -15123.4372146492
## EM - mixRHLP: Iteration: 90 | log-likelihood: -15121.2712280838
## EM - mixRHLP: Iteration: 91 | log-likelihood: -15119.0622569399
## EM - mixRHLP: Iteration: 92 | log-likelihood: -15116.787403138
## EM - mixRHLP: Iteration: 93 | log-likelihood: -15114.4192658117
## EM - mixRHLP: Iteration: 94 | log-likelihood: -15111.924529349
## EM - mixRHLP: Iteration: 95 | log-likelihood: -15109.2620474528
## EM - mixRHLP: Iteration: 96 | log-likelihood: -15106.3802520755
## EM - mixRHLP: Iteration: 97 | log-likelihood: -15103.213706005
## EM - mixRHLP: Iteration: 98 | log-likelihood: -15099.6787565348
## EM - mixRHLP: Iteration: 99 | log-likelihood: -15095.6664401391
## EM - mixRHLP: Iteration: 100 | log-likelihood: -15091.0341403178
## EM - mixRHLP: Iteration: 101 | log-likelihood: -15085.5952982163
## EM - mixRHLP: Iteration: 102 | log-likelihood: -15079.1100803654
## EM - mixRHLP: Iteration: 103 | log-likelihood: -15071.2863216179
## EM - mixRHLP: Iteration: 104 | log-likelihood: -15061.8155026979
## EM - mixRHLP: Iteration: 105 | log-likelihood: -15050.493194885
## EM - mixRHLP: Iteration: 106 | log-likelihood: -15037.4728805028
## EM - mixRHLP: Iteration: 107 | log-likelihood: -15023.5663638752
## EM - mixRHLP: Iteration: 108 | log-likelihood: -15010.227713093
## EM - mixRHLP: Iteration: 109 | log-likelihood: -14998.9216243832
## EM - mixRHLP: Iteration: 110 | log-likelihood: -14990.3428946346
## EM - mixRHLP: Iteration: 111 | log-likelihood: -14984.2931646878
## EM - mixRHLP: Iteration: 112 | log-likelihood: -14980.0317051081
## EM - mixRHLP: Iteration: 113 | log-likelihood: -14976.7574542656
## EM - mixRHLP: Iteration: 114 | log-likelihood: -14973.9768267613
## EM - mixRHLP: Iteration: 115 | log-likelihood: -14971.53042358
## EM - mixRHLP: Iteration: 116 | log-likelihood: -14969.3710026576
## EM - mixRHLP: Iteration: 117 | log-likelihood: -14967.3301314653
## EM - mixRHLP: Iteration: 118 | log-likelihood: -14965.131973297
## EM - mixRHLP: Iteration: 119 | log-likelihood: -14962.8186262617
## EM - mixRHLP: Iteration: 120 | log-likelihood: -14961.1657986143
## EM - mixRHLP: Iteration: 121 | log-likelihood: -14960.1001793785
## EM - mixRHLP: Iteration: 122 | log-likelihood: -14959.2029493367
## EM - mixRHLP: Iteration: 123 | log-likelihood: -14958.3643653586
## EM - mixRHLP: Iteration: 124 | log-likelihood: -14957.5579272925
## EM - mixRHLP: Iteration: 125 | log-likelihood: -14956.7769206483
## EM - mixRHLP: Iteration: 126 | log-likelihood: -14956.022083217
## EM - mixRHLP: Iteration: 127 | log-likelihood: -14955.299006836
## EM - mixRHLP: Iteration: 128 | log-likelihood: -14954.608093697
## EM - mixRHLP: Iteration: 129 | log-likelihood: -14953.9546052564
## EM - mixRHLP: Iteration: 130 | log-likelihood: -14953.3424683059
## EM - mixRHLP: Iteration: 131 | log-likelihood: -14952.7742704939
## EM - mixRHLP: Iteration: 132 | log-likelihood: -14952.2512735497
## EM - mixRHLP: Iteration: 133 | log-likelihood: -14951.7732467981
## EM - mixRHLP: Iteration: 134 | log-likelihood: -14951.3384384809
## EM - mixRHLP: Iteration: 135 | log-likelihood: -14950.9439547408
## EM - mixRHLP: Iteration: 136 | log-likelihood: -14950.5860673354
## EM - mixRHLP: Iteration: 137 | log-likelihood: -14950.2605961897
## EM - mixRHLP: Iteration: 138 | log-likelihood: -14949.963230213
## EM - mixRHLP: Iteration: 139 | log-likelihood: -14949.6897803653
## EM - mixRHLP: Iteration: 140 | log-likelihood: -14949.4363440455
## EM - mixRHLP: Iteration: 141 | log-likelihood: -14949.1993934228
## EM - mixRHLP: Iteration: 142 | log-likelihood: -14948.9758045696
## EM - mixRHLP: Iteration: 143 | log-likelihood: -14948.762846259
## EM - mixRHLP: Iteration: 144 | log-likelihood: -14948.5581447379
## EM - mixRHLP: Iteration: 145 | log-likelihood: -14948.3596363682
## EM - mixRHLP: Iteration: 146 | log-likelihood: -14948.1655161461
## EM - mixRHLP: Iteration: 147 | log-likelihood: -14947.9741866798
## EM - mixRHLP: Iteration: 148 | log-likelihood: -14947.7842100477
## EM - mixRHLP: Iteration: 149 | log-likelihood: -14947.5942633219
## EM - mixRHLP: Iteration: 150 | log-likelihood: -14947.4030977374
## EM - mixRHLP: Iteration: 151 | log-likelihood: -14947.2095010104
## EM - mixRHLP: Iteration: 152 | log-likelihood: -14947.0122620326
## EM - mixRHLP: Iteration: 153 | log-likelihood: -14946.8101371793
## EM - mixRHLP: Iteration: 154 | log-likelihood: -14946.6018173841
## EM - mixRHLP: Iteration: 155 | log-likelihood: -14946.3858952151
## EM - mixRHLP: Iteration: 156 | log-likelihood: -14946.1608311985
## EM - mixRHLP: Iteration: 157 | log-likelihood: -14945.9249187508
## EM - mixRHLP: Iteration: 158 | log-likelihood: -14945.6762471137
## EM - mixRHLP: Iteration: 159 | log-likelihood: -14945.4126618297
## EM - mixRHLP: Iteration: 160 | log-likelihood: -14945.131722454
## EM - mixRHLP: Iteration: 161 | log-likelihood: -14944.8306573877
## EM - mixRHLP: Iteration: 162 | log-likelihood: -14944.5063159956
## EM - mixRHLP: Iteration: 163 | log-likelihood: -14944.155118416
## EM - mixRHLP: Iteration: 164 | log-likelihood: -14943.7730037118
## EM - mixRHLP: Iteration: 165 | log-likelihood: -14943.3553771271
## EM - mixRHLP: Iteration: 166 | log-likelihood: -14942.8970570766
## EM - mixRHLP: Iteration: 167 | log-likelihood: -14942.3922219749
## EM - mixRHLP: Iteration: 168 | log-likelihood: -14941.834355991
## EM - mixRHLP: Iteration: 169 | log-likelihood: -14941.216191246
## EM - mixRHLP: Iteration: 170 | log-likelihood: -14940.5296396945
## EM - mixRHLP: Iteration: 171 | log-likelihood: -14939.7657190907
## EM - mixRHLP: Iteration: 172 | log-likelihood: -14938.9144460257
## EM - mixRHLP: Iteration: 173 | log-likelihood: -14937.9647057433
## EM - mixRHLP: Iteration: 174 | log-likelihood: -14936.9040831036
## EM - mixRHLP: Iteration: 175 | log-likelihood: -14935.7186499804
## EM - mixRHLP: Iteration: 176 | log-likelihood: -14934.3927038797
## EM - mixRHLP: Iteration: 177 | log-likelihood: -14932.9084527348
## EM - mixRHLP: Iteration: 178 | log-likelihood: -14931.2456399882
## EM - mixRHLP: Iteration: 179 | log-likelihood: -14929.381102618
## EM - mixRHLP: Iteration: 180 | log-likelihood: -14927.2882537206
## EM - mixRHLP: Iteration: 181 | log-likelihood: -14924.9364821771
## EM - mixRHLP: Iteration: 182 | log-likelihood: -14922.2904675262
## EM - mixRHLP: Iteration: 183 | log-likelihood: -14919.3094231841
## EM - mixRHLP: Iteration: 184 | log-likelihood: -14915.9463144564
## EM - mixRHLP: Iteration: 185 | log-likelihood: -14912.1471647531
## EM - mixRHLP: Iteration: 186 | log-likelihood: -14907.8506901878
## EM - mixRHLP: Iteration: 187 | log-likelihood: -14902.9887290218
## EM - mixRHLP: Iteration: 188 | log-likelihood: -14897.4883102615
## EM - mixRHLP: Iteration: 189 | log-likelihood: -14891.2767683179
## EM - mixRHLP: Iteration: 190 | log-likelihood: -14884.2919447286
## EM - mixRHLP: Iteration: 191 | log-likelihood: -14876.4995909501
## EM - mixRHLP: Iteration: 192 | log-likelihood: -14867.9179321604
## EM - mixRHLP: Iteration: 193 | log-likelihood: -14858.6442978067
## EM - mixRHLP: Iteration: 194 | log-likelihood: -14848.8804337987
## EM - mixRHLP: Iteration: 195 | log-likelihood: -14838.9872847628
## EM - mixRHLP: Iteration: 196 | log-likelihood: -14829.6292321636
## EM - mixRHLP: Iteration: 197 | log-likelihood: -14821.8717823271
## EM - mixRHLP: Iteration: 198 | log-likelihood: -14816.6461671926
## EM - mixRHLP: Iteration: 199 | log-likelihood: -14813.7497363608
## EM - mixRHLP: Iteration: 200 | log-likelihood: -14812.2267827379
## EM - mixRHLP: Iteration: 201 | log-likelihood: -14811.4198286997
## EM - mixRHLP: Iteration: 202 | log-likelihood: -14811.0049216909
## EM - mixRHLP: Iteration: 203 | log-likelihood: -14810.7960368369
## EM - mixRHLP: Iteration: 204 | log-likelihood: -14810.6883875632
mixrhlp$summary()
## ------------------------
## Fitted mixRHLP model
## ------------------------
##
## MixRHLP model with K = 3 clusters and R = 3 regimes:
##
## log-likelihood nu AIC BIC ICL
## -14810.69 41 -14851.69 -14880.41 -14880.41
##
## Clustering table (Number of curves in each clusters):
##
## 1 2 3
## 10 10 10
##
## Mixing probabilities (cluster weights):
## 1 2 3
## 0.3333333 0.3333333 0.3333333
##
##
## --------------------
## Cluster 1 (k = 1):
##
## Regression coefficients for each regime/segment r (r=1...R):
##
## Beta(r = 1) Beta(r = 2) Beta(r = 3)
## 1 6.3513369 4.214736 6.6536553
## X^1 -0.2449377 0.839666 0.1024863
##
## Variances:
##
## Sigma2(r = 1) Sigma2(r = 2) Sigma2(r = 3)
## 0.9498285 0.9270384 1.001413
##
## --------------------
## Cluster 2 (k = 2):
##
## Regression coefficients for each regime/segment r (r=1...R):
##
## Beta(r = 1) Beta(r = 2) Beta(r = 3)
## 1 4.96556671 6.7326717 4.8807183
## X^1 0.08880479 0.4984443 0.1350271
##
## Variances:
##
## Sigma2(r = 1) Sigma2(r = 2) Sigma2(r = 3)
## 0.9559969 1.03849 0.9506928
##
## --------------------
## Cluster 3 (k = 3):
##
## Regression coefficients for each regime/segment r (r=1...R):
##
## Beta(r = 1) Beta(r = 2) Beta(r = 3)
## 1 6.8902863 5.1134337 3.90153421
## X^1 0.9265632 -0.3959402 0.08748466
##
## Variances:
##
## Sigma2(r = 1) Sigma2(r = 2) Sigma2(r = 3)
## 0.981915 0.9787717 0.9702211