Skip to content

Commit

Permalink
optim in PLNnetwork should not start by final PLN cov, but current es…
Browse files Browse the repository at this point in the history
…timate (M'M + diag(S))
  • Loading branch information
jchiquet committed Sep 10, 2024
1 parent d02fe68 commit 5ffdf38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inst/case_studies/oaks_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ factoextra::fviz_pca_biplot(
labs(col = "distance (cm)") + scale_color_viridis_c()

## Network inference with sparce covariance estimation
system.time(myPLNnets <- PLNnetwork(Abundance ~ 0 + tree + offset(log(Offset)), data = oaks, control = PLNnetwork_param(min_ratio = 0.05)))

system.time(myZIPLNnets <- ZIPLNnetwork(Abundance ~ 0 + tree + offset(log(Offset)), zi = "single", data = oaks, control = ZIPLNnetwork_param(min_ratio = 0.1)))

system.time(myPLNnets <- PLNnetwork(Abundance ~ 0 + tree + offset(log(Offset)), data = oaks, control = PLNnetwork_param(min_ratio = 0.1)))
plot(myPLNnets)
plot(getBestModel(myPLNnets, "EBIC"))
# stability_selection(myPLNnets)
Expand Down
13 changes: 13 additions & 0 deletions inst/check/objective_zipln.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
library(PLNmodels)
data(oaks)

myPLN <- PLN(Abundance ~ 0 + tree + offset(log(Offset)), data = oaks)
myZIPLN <- ZIPLN(Abundance ~ 0 + tree + offset(log(Offset)) | 0 + tree, data = oaks)

## bricolage car quelques points explosent, sans conséquences sur la convergence finale
obj_PLN <- -myPLN$optim_par$objective
plot(obj_PLN, ## optimisation nlopt de la vraisemblance profilée
ylim = c(obj_PLN[1], # fonction objective sans les constantes
tail(obj_PLN,1)), log = "xy")

plot(myZIPLN$optim_par$objective, type = "l", log = "xy") ## Les itérations du VEM: la vraisemblance estimée

0 comments on commit 5ffdf38

Please sign in to comment.