From 27ea92f8d084780c6d8cdc99d53f9b8d8defaed0 Mon Sep 17 00:00:00 2001 From: Lizhong Chen Date: Thu, 25 Nov 2021 11:18:59 +1100 Subject: [PATCH] update --- .Rhistory | 326 +++++++++--------- .Rproj.user/3992D3D4/cpp-definition-cache | 1 - .../3992D3D4/pcs/debug-breakpoints.pper | 5 - .Rproj.user/3992D3D4/pcs/files-pane.pper | 9 - .Rproj.user/3992D3D4/pcs/packages-pane.pper | 7 - .Rproj.user/3992D3D4/pcs/source-pane.pper | 3 - .../3992D3D4/pcs/windowlayoutstate.pper | 14 - .Rproj.user/3992D3D4/pcs/workbench-pane.pper | 5 - .../profiles-cache/file5c1c35e71129.Rprof | 1 - .Rproj.user/3992D3D4/rmd-outputs | 10 - .Rproj.user/3992D3D4/saved_source_markers | 1 - .Rproj.user/3992D3D4/sources/prop/23F6439F | 4 - .Rproj.user/3992D3D4/sources/prop/25B3AAD6 | 5 - .Rproj.user/3992D3D4/sources/prop/352966FF | 5 - .Rproj.user/3992D3D4/sources/prop/354CB43F | 1 - .Rproj.user/3992D3D4/sources/prop/36CC97DB | 5 - .Rproj.user/3992D3D4/sources/prop/3AA9A4FC | 5 - .Rproj.user/3992D3D4/sources/prop/43B20C7B | 1 - .Rproj.user/3992D3D4/sources/prop/4CFCE487 | 5 - .Rproj.user/3992D3D4/sources/prop/4F1C9B07 | 1 - .Rproj.user/3992D3D4/sources/prop/5380A78C | 5 - .Rproj.user/3992D3D4/sources/prop/63A0B237 | 5 - .Rproj.user/3992D3D4/sources/prop/6ADD8893 | 5 - .Rproj.user/3992D3D4/sources/prop/6B6242EF | 1 - .Rproj.user/3992D3D4/sources/prop/7C8C31A9 | 5 - .Rproj.user/3992D3D4/sources/prop/7EC5EA7B | 5 - .Rproj.user/3992D3D4/sources/prop/7F8B6960 | 5 - .Rproj.user/3992D3D4/sources/prop/80CD3E7A | 1 - .Rproj.user/3992D3D4/sources/prop/847F629C | 1 - .Rproj.user/3992D3D4/sources/prop/86C3D5DC | 4 - .Rproj.user/3992D3D4/sources/prop/8DF4A0BB | 5 - .Rproj.user/3992D3D4/sources/prop/8E74A7E8 | 5 - .Rproj.user/3992D3D4/sources/prop/8F7C148B | 5 - .Rproj.user/3992D3D4/sources/prop/97399623 | 5 - .Rproj.user/3992D3D4/sources/prop/AA8888B6 | 5 - .Rproj.user/3992D3D4/sources/prop/ADDA4E66 | 5 - .Rproj.user/3992D3D4/sources/prop/B6F436B8 | 5 - .Rproj.user/3992D3D4/sources/prop/BAAC6886 | 1 - .Rproj.user/3992D3D4/sources/prop/C361053E | 5 - .Rproj.user/3992D3D4/sources/prop/C7D401C2 | 5 - .Rproj.user/3992D3D4/sources/prop/CEE0A27E | 1 - .Rproj.user/3992D3D4/sources/prop/D1765424 | 6 - .Rproj.user/3992D3D4/sources/prop/ECE0FFE8 | 4 - .Rproj.user/3992D3D4/sources/prop/EE17ED8B | 4 - .Rproj.user/3992D3D4/sources/prop/EF1AA608 | 1 - .Rproj.user/3992D3D4/sources/prop/F2054525 | 1 - .Rproj.user/3992D3D4/sources/prop/F41F9CA2 | 5 - .Rproj.user/3992D3D4/sources/prop/FCD88EE5 | 5 - .Rproj.user/3992D3D4/sources/prop/INDEX | 37 -- .../3992D3D4/sources/s-54CE4874/088D3205 | 25 -- .../sources/s-54CE4874/24ECBBFE-contents | 52 --- .../sources/s-54CE4874/2856D250-contents | 50 --- .../sources/s-54CE4874/3A7AE6B8-contents | 18 - .../3992D3D4/sources/s-54CE4874/4CA67785 | 25 -- .../sources/s-54CE4874/4CA67785-contents | 23 -- .../sources/s-54CE4874/57586E8E-contents | 49 --- .../3992D3D4/sources/s-54CE4874/7873540B | 25 -- .../sources/s-54CE4874/7873540B-contents | 139 -------- .../3992D3D4/sources/s-54CE4874/78CE84F3 | 25 -- .../sources/s-54CE4874/78CE84F3-contents | 53 --- .../3992D3D4/sources/s-54CE4874/7CE9D475 | 25 -- .../sources/s-54CE4874/7CE9D475-contents | 85 ----- .../sources/s-54CE4874/85AF2251-contents | 42 --- .../sources/s-54CE4874/8B86B8B0-contents | 49 --- .../sources/s-54CE4874/94B44AE0-contents | 53 --- .../sources/s-54CE4874/A84E6ABC-contents | 0 .../sources/s-54CE4874/BF4BF218-contents | 63 ---- .../sources/s-54CE4874/CB089875-contents | 29 -- .../sources/s-54CE4874/D5947A0F-contents | 12 - .../3992D3D4/sources/s-54CE4874/D7ECB8CA | 25 -- .../sources/s-54CE4874/D7ECB8CA-contents | 105 ------ .../sources/s-54CE4874/E70C6D4E-contents | 63 ---- .../sources/s-54CE4874/F32FF4B2-contents | 20 -- .../sources/s-54CE4874/F8F1ED40-contents | 42 --- .../3992D3D4/sources/s-54CE4874/lock_file | 0 .../sources/s-9F8C73CA/0BB553A0-contents | 53 --- .../sources/s-9F8C73CA/0C641D94-contents | 0 .../sources/s-9F8C73CA/142B84EE-contents | 0 .../3992D3D4/sources/s-9F8C73CA/1746EC9F | 25 -- .../sources/s-9F8C73CA/1746EC9F-contents | 25 -- .../sources/s-9F8C73CA/19D42942-contents | 16 - .../sources/s-9F8C73CA/1E3E404A-contents | 53 --- .../3992D3D4/sources/s-9F8C73CA/1FFCF13A | 25 -- .../sources/s-9F8C73CA/1FFCF13A-contents | 51 --- .../3992D3D4/sources/s-9F8C73CA/254CACE3 | 25 -- .../sources/s-9F8C73CA/254CACE3-contents | 49 --- .../sources/s-9F8C73CA/26534912-contents | 24 -- .../sources/s-9F8C73CA/39E35C2F-contents | 50 --- .../3992D3D4/sources/s-9F8C73CA/462FD7FF | 26 -- .../sources/s-9F8C73CA/462FD7FF-contents | 78 ----- .../3992D3D4/sources/s-9F8C73CA/5F434AFC | 24 -- .../sources/s-9F8C73CA/5F434AFC-contents | 22 -- .../sources/s-9F8C73CA/63330167-contents | 48 --- .../sources/s-9F8C73CA/660ECE08-contents | 70 ---- .../sources/s-9F8C73CA/6DA8FBCF-contents | 0 .../sources/s-9F8C73CA/753DF263-contents | 12 - .../3992D3D4/sources/s-9F8C73CA/88DC9410 | 25 -- .../sources/s-9F8C73CA/88DC9410-contents | 53 --- .../3992D3D4/sources/s-9F8C73CA/8A9A8E5D | 24 -- .../sources/s-9F8C73CA/8A9A8E5D-contents | 12 - .../sources/s-9F8C73CA/94BB89D5-contents | 48 --- .../sources/s-9F8C73CA/978A2B61-contents | 25 -- .../sources/s-9F8C73CA/9A53FC16-contents | 189 ---------- .../sources/s-9F8C73CA/A073AC50-contents | 0 .../3992D3D4/sources/s-9F8C73CA/A15EC043 | 25 -- .../sources/s-9F8C73CA/A15EC043-contents | 29 -- .../3992D3D4/sources/s-9F8C73CA/BDFFCD1C | 25 -- .../sources/s-9F8C73CA/BDFFCD1C-contents | 19 - .../sources/s-9F8C73CA/C1EF0210-contents | 41 --- .../sources/s-9F8C73CA/C99CC9CF-contents | 53 --- .../sources/s-9F8C73CA/CABE8B9A-contents | 0 .../sources/s-9F8C73CA/D58D0530-contents | 0 .../3992D3D4/sources/s-9F8C73CA/D5BDC948 | 25 -- .../sources/s-9F8C73CA/D5BDC948-contents | 13 - .../3992D3D4/sources/s-9F8C73CA/DD4A4CFB | 25 -- .../sources/s-9F8C73CA/DD4A4CFB-contents | 49 --- .../sources/s-9F8C73CA/E0E1F12B-contents | 0 .../sources/s-9F8C73CA/E0FCB66E-contents | 48 --- .../sources/s-9F8C73CA/E99762E1-contents | 0 .../sources/s-9F8C73CA/EB2F615D-contents | 0 .../3992D3D4/sources/s-9F8C73CA/EB3BE702 | 25 -- .../sources/s-9F8C73CA/EB3BE702-contents | 25 -- .../sources/s-9F8C73CA/F03A716A-contents | 0 .../sources/s-9F8C73CA/F0645852-contents | 22 -- .../sources/s-9F8C73CA/FD181623-contents | 12 - .../3992D3D4/sources/s-9F8C73CA/lock_file | 0 .../1/3992D3D49C10954F/chunks.json | 1 - .../1/3992D3D49F8C73CA/chunks.json | 1 - .../1/s/c3w38ulaltibg/000002.csv | 6 - .../1/s/c3w38ulaltibg/000003.error | 1 - .../1/s/c3y5icinxq7eg/000002.csv | 9 - .../1/s/c93jpyd1jmhhi/000002.csv | 8 - .../1/s/c9kilm1aj7mw3/000002.csv | 6 - .../1/s/cbmf9q6dlwd8j/000002.csv | 1 - .../1/s/cbmf9q6dlwd8j/000003.metadata | 1 - .../1/s/cbmf9q6dlwd8j/000003.png | Bin 1701 -> 0 bytes .../1/s/cbmf9q6dlwd8j/000003.snapshot | Bin 1672 -> 0 bytes .../1/s/cfq06oe8jrdlh/000002.csv | 2 - .../notebooks/8107308D-IBGS/1/s/chunks.json | 1 - .../1/s/cjpy5g7olmz1k/000004.csv | 1 - .../1/s/cjpy5g7olmz1k/000005.metadata | 1 - .../1/s/cjpy5g7olmz1k/000005.png | Bin 5265 -> 0 bytes .../1/s/cjpy5g7olmz1k/000005.snapshot | Bin 1860 -> 0 bytes .../1/s/cmory16znzyvn/000002.csv | 15 - .../1/s/cqmvnsw06ftmj/000002.csv | 3 - .../1/s/cs0ac6ddzb89k/000002.csv | 120 ------- .../1/s/cs66fm6jqvos8/000002.csv | 4 - .../8107308D-IBGS/1/s/csetup_chunk/000002.csv | 1 - .../1/s/cubqz02zklowi/000002.csv | 2 - .../1/s/cz52i8jarnd8t/000002.csv | 2 - .../shared/notebooks/patch-chunk-names | 0 .Rproj.user/shared/notebooks/paths | 33 -- DESCRIPTION | 2 +- NAMESPACE | 6 +- R/ichart.R | 8 +- R/modelfreq.R | 10 + .../088D3205-contents => R/variableranking.R | 2 +- man/plots.ichart.Rd | 14 + man/plots.mf.Rd | 14 + man/plots.vr.Rd | 16 + 160 files changed, 231 insertions(+), 3206 deletions(-) delete mode 100644 .Rproj.user/3992D3D4/cpp-definition-cache delete mode 100644 .Rproj.user/3992D3D4/pcs/debug-breakpoints.pper delete mode 100644 .Rproj.user/3992D3D4/pcs/files-pane.pper delete mode 100644 .Rproj.user/3992D3D4/pcs/packages-pane.pper delete mode 100644 .Rproj.user/3992D3D4/pcs/source-pane.pper delete mode 100644 .Rproj.user/3992D3D4/pcs/windowlayoutstate.pper delete mode 100644 .Rproj.user/3992D3D4/pcs/workbench-pane.pper delete mode 100644 .Rproj.user/3992D3D4/profiles-cache/file5c1c35e71129.Rprof delete mode 100644 .Rproj.user/3992D3D4/rmd-outputs delete mode 100644 .Rproj.user/3992D3D4/saved_source_markers delete mode 100644 .Rproj.user/3992D3D4/sources/prop/23F6439F delete mode 100644 .Rproj.user/3992D3D4/sources/prop/25B3AAD6 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/352966FF delete mode 100644 .Rproj.user/3992D3D4/sources/prop/354CB43F delete mode 100644 .Rproj.user/3992D3D4/sources/prop/36CC97DB delete mode 100644 .Rproj.user/3992D3D4/sources/prop/3AA9A4FC delete mode 100644 .Rproj.user/3992D3D4/sources/prop/43B20C7B delete mode 100644 .Rproj.user/3992D3D4/sources/prop/4CFCE487 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/4F1C9B07 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/5380A78C delete mode 100644 .Rproj.user/3992D3D4/sources/prop/63A0B237 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/6ADD8893 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/6B6242EF delete mode 100644 .Rproj.user/3992D3D4/sources/prop/7C8C31A9 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/7EC5EA7B delete mode 100644 .Rproj.user/3992D3D4/sources/prop/7F8B6960 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/80CD3E7A delete mode 100644 .Rproj.user/3992D3D4/sources/prop/847F629C delete mode 100644 .Rproj.user/3992D3D4/sources/prop/86C3D5DC delete mode 100644 .Rproj.user/3992D3D4/sources/prop/8DF4A0BB delete mode 100644 .Rproj.user/3992D3D4/sources/prop/8E74A7E8 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/8F7C148B delete mode 100644 .Rproj.user/3992D3D4/sources/prop/97399623 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/AA8888B6 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/ADDA4E66 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/B6F436B8 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/BAAC6886 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/C361053E delete mode 100644 .Rproj.user/3992D3D4/sources/prop/C7D401C2 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/CEE0A27E delete mode 100644 .Rproj.user/3992D3D4/sources/prop/D1765424 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/ECE0FFE8 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/EE17ED8B delete mode 100644 .Rproj.user/3992D3D4/sources/prop/EF1AA608 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/F2054525 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/F41F9CA2 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/FCD88EE5 delete mode 100644 .Rproj.user/3992D3D4/sources/prop/INDEX delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/088D3205 delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/24ECBBFE-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/2856D250-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/3A7AE6B8-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785 delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/57586E8E-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/7873540B delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/7873540B-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3 delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475 delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/85AF2251-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/8B86B8B0-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/94B44AE0-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/A84E6ABC-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/BF4BF218-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/CB089875-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/D5947A0F-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/E70C6D4E-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/F32FF4B2-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/F8F1ED40-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-54CE4874/lock_file delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/0BB553A0-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/0C641D94-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/142B84EE-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/19D42942-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/1E3E404A-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/26534912-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/39E35C2F-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/63330167-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/660ECE08-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/6DA8FBCF-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/753DF263-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410 delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/94BB89D5-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/978A2B61-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/A073AC50-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/C1EF0210-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/C99CC9CF-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/CABE8B9A-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/D58D0530-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948 delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/E0E1F12B-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/E0FCB66E-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/E99762E1-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/EB2F615D-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/F03A716A-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/F0645852-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/FD181623-contents delete mode 100644 .Rproj.user/3992D3D4/sources/s-9F8C73CA/lock_file delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49C10954F/chunks.json delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000003.error delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3y5icinxq7eg/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.snapshot delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000004.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.metadata delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.png delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.snapshot delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cmory16znzyvn/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cqmvnsw06ftmj/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs0ac6ddzb89k/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv delete mode 100644 .Rproj.user/shared/notebooks/patch-chunk-names delete mode 100644 .Rproj.user/shared/notebooks/paths create mode 100644 R/modelfreq.R rename .Rproj.user/3992D3D4/sources/s-54CE4874/088D3205-contents => R/variableranking.R (92%) create mode 100644 man/plots.ichart.Rd create mode 100644 man/plots.mf.Rd create mode 100644 man/plots.vr.Rd diff --git a/.Rhistory b/.Rhistory index 2801790..04c5fcd 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,166 +1,3 @@ -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -} -w <- rep(0.5,len=KK) -print(head(Pred)) -m = 3 -COM <- m -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -print(Pred[i,COM]) -} -i=1 -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -summary(fit) -cor(E) -View(AX) -z$Coriolis_parameter_absolute -tcg <- read.csv("TC_data_12h_AR_Matched.csv") -z1 <- tcg[,8:157] -z <- z1(,!colnames(z) == "Coriolis_parameter_absolute") -z <- z1(,!colnames(z1) == "Coriolis_parameter_absolute") -z <- z1[,!(colnames(z1) == "Coriolis_parameter_absolute")] -y <- z$y -x <- as.matrix(z[,-1]) -n <- dim(x)[1] -p <- dim(x)[2] -index_train <- sample(x = 2, size = n, replace = TRUE, prob = c(0.8,0.2)) -x_train <- x[index_train == 1, ] -y_train <- y[index_train == 1 ] -x_test <- x[index_train == 2, ] -y_test <- y[index_train == 2 ] -AX <- x_train -y <- y_train -p <- PP <- ncol(AX) -n <- dim(AX)[1] -COV <- rep(0,len=PP) -for(i in 1:PP){ -fit <- glm(y~AX[,i],family=binomial()) -COV[i] <- (summary(fit)$coefficients)[2,4] -} -a <- cbind(1:PP,COV) -COV <- a[order(a[,2],decreasing=F),1:2] -NN <- NumbPred <- 10 #The number of predictors -KK <- trunc(sum(COV[,2]<=0.01)/NN) -Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK) -COM <- 1 -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients)) -#print(i) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -for(m in 2:KK){ -COM <- m -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -print(Pred[i,COM]) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -} -w <- rep(0.5,len=KK) -print(head(Pred)) -print(auc(y, Pred[,1])) -library(pROC) -print(auc(y, Pred[,1])) -print(auc(y, Pred[,2])) -Stein <- function(w){ -Pi <- exp(Pred%*%w)/(1+exp(Pred%*%w)) -ss <- -sum( y*log(Pi)+(1-y)*log(1-Pi) ) -ss -} -model <- optim(w,fn=Stein,method="L-BFGS-B",lower=rep(0,len=m),upper=rep(1,len=m)) -w <- model$par -Pred <- PRED%*%w -print(auc(y, Pred)) -print(auc(y, as.vector(Pred))) -y.t <- y_test -Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK); PRED.t <- matrix(0,n,KK) -COM <- 1 -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]); E.t <- as.matrix(x_test[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients)) -#print(i) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -for(m in 2:KK){ -COM <- m -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -} -w <- rep(0.5,len=KK) -Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK); PRED.t <- matrix(0,n1,KK) -COM <- 1 -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]); E.t <- as.matrix(x_test[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients)) -#print(i) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -for(m in 2:KK){ -COM <- m -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -} -n1 <- dim(x_test)[1] -Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK); PRED.t <- matrix(0,n1,KK) -COM <- 1 -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]); E.t <- as.matrix(x_test[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients)) -#print(i) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -for(m in 2:KK){ -COM <- m -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) -for(i in 1:n){ -fit <- glm(y[-i]~E[-i,],binomial(link="logit")) -Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) -} -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -} -w <- rep(0.5,len=KK) -print(head(Pred)) -print(auc(y, Pred[,1])) -print(auc(y, Pred[,2])) -Stein <- function(w){ -Pi <- exp(Pred%*%w)/(1+exp(Pred%*%w)) ss <- -sum( y*log(Pi)+(1-y)*log(1-Pi) ) ss } @@ -510,3 +347,166 @@ remove.packages(IBGS) source('H:/UbuntuRv2/IBGS/IBGS/R/gibbs.R', echo=TRUE) source('H:/UbuntuRv2/IBGS/IBGS/R/gibbs.R', echo=TRUE) devtools::check() +devtools::check() +devtools::check() +devtools::build() +devtools::install() +library(IBGS) +devtools::build() +devtools::check() +devtools::check() +devtools::check() +devtools::build() +load("H:/UbuntuRv2/IBGS/test1.RData") +View(m.l1) +v <- m.l1$m.sic +n <- length(v) +n.half <- n/2 +v.min <- min(v) +v.sd <- sd(v) +v.mean <- mean(v) +v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) +v.min.half <- min(v[1:n.half]) +v.sd.half <- sd(v[1:n.half]) +v.mean.half <- mean(v[1:n.half]) +v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) +plot(1:n, v, type = "l") +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values") +abline(h = v.upper, col = "red", lty = 2) +abline(h = v.upper.half, col = "red", lty = 2) +abline(h = v.upper.half, col = "blue", lty = 2) +abline(h = v.upper.half, col = "blue", lty = 3) +abline(h = v.upper.half, col = "blue", lty = 4) +abline(h = v.upper.half, col = "blue", lty = 5) +abline(h = v.upper.half, col = "blue", lty = 1) +abline(h = v.upper.half, col = "blue", lty = 3) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values") +abline(h = v.upper, col = "red", lty = 2) +abline(h = v.upper.half, col = "blue", lty = 3) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values") +abline(h = v.upper, col = "red", lty = 2) +abline(h = v.upper.half, xlim=c(0,n.half), col = "blue", lty = 3) +lines(1:n.half, v.upper ) +lines(1:n.half, rep(v.upper, n.half) ) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values") +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values", +main = "I-chart for the generated sequence") +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +ichart.Gibbs <- function(result){ +v <- result$m.sic +n <- length(v) +n.half <- n/2 +v.min <- min(v) +v.sd <- sd(v) +v.mean <- mean(v) +v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) +v.min.half <- min(v[1:n.half]) +v.sd.half <- sd(v[1:n.half]) +v.mean.half <- mean(v[1:n.half]) +v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values", +main = "I-chart for the generated sequence") +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +} +ichart.Gibbs(m.l1) +ichart.Gibbs(m.l1) +ichart.Gibbs(m.s1) +paste("A","B", "C") +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values", +main = paste("I-chart for the generated", result$info, "sequence")) +ichart.Gibbs <- function(result){ +v <- result$m.sic +n <- length(v) +n.half <- n/2 +v.min <- min(v) +v.sd <- sd(v) +v.mean <- mean(v) +v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) +v.min.half <- min(v[1:n.half]) +v.sd.half <- sd(v[1:n.half]) +v.mean.half <- mean(v[1:n.half]) +v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) +plot(1:n, v, type = "l", xlab = "Generations", ylab = "Values", +main = paste("I-chart for the generated", result$info, "sequence")) +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +} +ichart.Gibbs(m.s1) +ichart.Gibbs <- function(result){ +v <- result$m.sic +n <- length(v) +n.half <- n/2 +v.min <- min(v) +v.sd <- sd(v) +v.mean <- mean(v) +v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) +v.min.half <- min(v[1:n.half]) +v.sd.half <- sd(v[1:n.half]) +v.mean.half <- mean(v[1:n.half]) +v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) +plot(1:n, v, type = "l", xlab = "Generations", ylab = paste(result$info, "Values"), +main = paste("I-chart for the generated", result$info, "sequence")) +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +} +ichart.Gibbs(m.s1) +devtools::check() +devtools::build() +devtools::install() +devtools::install() +setwd("H:/UbuntuRv2/IBGS") +install.packages("IBGS_0.1.2.tar.gz", repos = NULL) +setwd("H:/UbuntuRv2/STC/Approach2/poisson") +setwd("H:/UbuntuRv2/STC/Final") +library(IBGS) +#data +STC <- read.csv("STC.csv") +#predictors +x <- as.matrix(STC[,10:45]) +colnames(x) <- c("DMSLP.Aug", "TMSLP.Aug", "DMI.Aug", "DMIE.Aug", "DMIW.Aug", "QBO.Aug", +"SOI.Aug", "N12.Aug", "N34.Aug", "N3.Aug", "N4.Aug", "EMI.Aug", +"DMSLP.Sep", "TMSLP.Sep", "DMI.Sep", "DMIE.Sep", "DMIW.Sep", "QBO.Sep" , +"SOI.Sep" , "N12.Sep" , "N34.Sep" , "N3.Sep" , "N4.Sep" , "EMI.Sep" , +"DMSLP.Oct", "TMSLP.Oct", "DMI.Oct" , "DMIE.Oct" , "DMIW.Oct", "QBO.Oct" , +"SOI.Oct" , "N12.Oct" , "N34.Oct", "N3.Oct" , "N4.Oct" , "EMI.Oct") +i = 1 +#response variables +w <- STC[,2:9] +n <- dim(x)[1] +p <- dim(x)[2] +#Gibbs sampler results +TC.gs <- list() +TC.gs[[i]] <- GibbsSampler(y, x, n.models = 5, k = 2, +info = "AICc", family = "poisson") +y <- w[,i] +TC.gs[[i]] <- GibbsSampler(y, x, n.models = 5, k = 2, +info = "AICc", family = "poisson") +#' I-chart for the generated sequence +#' +#' @param result a list of results +#' +#' @export +ichart.Gibbs <- function(result){ +v <- result$m.sic +n <- length(v) +n.half <- n/2 +v.min <- min(v) +v.sd <- sd(v) +v.mean <- mean(v) +v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) +v.min.half <- min(v[1:n.half]) +v.sd.half <- sd(v[1:n.half]) +v.mean.half <- mean(v[1:n.half]) +v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) +plot(1:n, v, type = "l", xlab = "Generations", ylab = paste(result$info, "Values"), +main = paste("I-chart for the generated", result$info, "sequence")) +lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) +lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) +} +ichart.Gibbs(TC.gs[[1]]) +devtools::check() +devtools::check() diff --git a/.Rproj.user/3992D3D4/cpp-definition-cache b/.Rproj.user/3992D3D4/cpp-definition-cache deleted file mode 100644 index 0637a08..0000000 --- a/.Rproj.user/3992D3D4/cpp-definition-cache +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/debug-breakpoints.pper b/.Rproj.user/3992D3D4/pcs/debug-breakpoints.pper deleted file mode 100644 index 4893a8a..0000000 --- a/.Rproj.user/3992D3D4/pcs/debug-breakpoints.pper +++ /dev/null @@ -1,5 +0,0 @@ -{ - "debugBreakpointsState": { - "breakpoints": [] - } -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/files-pane.pper b/.Rproj.user/3992D3D4/pcs/files-pane.pper deleted file mode 100644 index 0dd21fb..0000000 --- a/.Rproj.user/3992D3D4/pcs/files-pane.pper +++ /dev/null @@ -1,9 +0,0 @@ -{ - "sortOrder": [ - { - "columnIndex": 2, - "ascending": true - } - ], - "path": "H:/UbuntuRv2/IBGS/IBGS" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/packages-pane.pper b/.Rproj.user/3992D3D4/pcs/packages-pane.pper deleted file mode 100644 index 4abdd5c..0000000 --- a/.Rproj.user/3992D3D4/pcs/packages-pane.pper +++ /dev/null @@ -1,7 +0,0 @@ -{ - "installOptions": { - "installFromRepository": true, - "libraryPath": "C:/Users/nealf/Documents/R/win-library/4.0", - "installDependencies": true - } -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/source-pane.pper b/.Rproj.user/3992D3D4/pcs/source-pane.pper deleted file mode 100644 index 28a3c2e..0000000 --- a/.Rproj.user/3992D3D4/pcs/source-pane.pper +++ /dev/null @@ -1,3 +0,0 @@ -{ - "activeTab": 3 -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/windowlayoutstate.pper b/.Rproj.user/3992D3D4/pcs/windowlayoutstate.pper deleted file mode 100644 index d44c116..0000000 --- a/.Rproj.user/3992D3D4/pcs/windowlayoutstate.pper +++ /dev/null @@ -1,14 +0,0 @@ -{ - "left": { - "splitterpos": 395, - "topwindowstate": "NORMAL", - "panelheight": 950, - "windowheight": 988 - }, - "right": { - "splitterpos": 592, - "topwindowstate": "NORMAL", - "panelheight": 950, - "windowheight": 988 - } -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/pcs/workbench-pane.pper b/.Rproj.user/3992D3D4/pcs/workbench-pane.pper deleted file mode 100644 index 96d2d45..0000000 --- a/.Rproj.user/3992D3D4/pcs/workbench-pane.pper +++ /dev/null @@ -1,5 +0,0 @@ -{ - "TabSet1": 0, - "TabSet2": 2, - "TabZoom": {} -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/profiles-cache/file5c1c35e71129.Rprof b/.Rproj.user/3992D3D4/profiles-cache/file5c1c35e71129.Rprof deleted file mode 100644 index e66a96e..0000000 --- a/.Rproj.user/3992D3D4/profiles-cache/file5c1c35e71129.Rprof +++ /dev/null @@ -1 +0,0 @@ -memory profiling: GC profiling: line profiling: sample.interval=10000 diff --git a/.Rproj.user/3992D3D4/rmd-outputs b/.Rproj.user/3992D3D4/rmd-outputs deleted file mode 100644 index 0c3b4bc..0000000 --- a/.Rproj.user/3992D3D4/rmd-outputs +++ /dev/null @@ -1,10 +0,0 @@ -H:/UbuntuRv2/TCGS/IBGS.pdf -H:/UbuntuRv2/TCGS/IBGS.pdf -H:/UbuntuRv2/TCGS/IBGS.pdf -H:/UbuntuRv2/TCGS/IBGS.pdf -H:/UbuntuRv2/TCGS/IBGS.pdf - - - - - diff --git a/.Rproj.user/3992D3D4/saved_source_markers b/.Rproj.user/3992D3D4/saved_source_markers deleted file mode 100644 index 2b1bef1..0000000 --- a/.Rproj.user/3992D3D4/saved_source_markers +++ /dev/null @@ -1 +0,0 @@ -{"active_set":"","sets":[]} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/23F6439F b/.Rproj.user/3992D3D4/sources/prop/23F6439F deleted file mode 100644 index 9b8ee03..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/23F6439F +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cursorPosition": "15,14", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/25B3AAD6 b/.Rproj.user/3992D3D4/sources/prop/25B3AAD6 deleted file mode 100644 index dfd7b5c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/25B3AAD6 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "11,44", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/352966FF b/.Rproj.user/3992D3D4/sources/prop/352966FF deleted file mode 100644 index bd6a9d9..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/352966FF +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "4,33", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/354CB43F b/.Rproj.user/3992D3D4/sources/prop/354CB43F deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/354CB43F +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/36CC97DB b/.Rproj.user/3992D3D4/sources/prop/36CC97DB deleted file mode 100644 index 85c181c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/36CC97DB +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled3", - "cursorPosition": "12,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/3AA9A4FC b/.Rproj.user/3992D3D4/sources/prop/3AA9A4FC deleted file mode 100644 index ee113f7..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/3AA9A4FC +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "5,39", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/43B20C7B b/.Rproj.user/3992D3D4/sources/prop/43B20C7B deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/43B20C7B +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/4CFCE487 b/.Rproj.user/3992D3D4/sources/prop/4CFCE487 deleted file mode 100644 index ab67d99..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/4CFCE487 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled3", - "cursorPosition": "8,18", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 b/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/5380A78C b/.Rproj.user/3992D3D4/sources/prop/5380A78C deleted file mode 100644 index 9c7ae5c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/5380A78C +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "23,37", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/63A0B237 b/.Rproj.user/3992D3D4/sources/prop/63A0B237 deleted file mode 100644 index 2ac4c8c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/63A0B237 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "38,31", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/6ADD8893 b/.Rproj.user/3992D3D4/sources/prop/6ADD8893 deleted file mode 100644 index 6540fad..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/6ADD8893 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "9,8", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/6B6242EF b/.Rproj.user/3992D3D4/sources/prop/6B6242EF deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/6B6242EF +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/7C8C31A9 b/.Rproj.user/3992D3D4/sources/prop/7C8C31A9 deleted file mode 100644 index 926901d..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/7C8C31A9 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled3", - "cursorPosition": "20,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/7EC5EA7B b/.Rproj.user/3992D3D4/sources/prop/7EC5EA7B deleted file mode 100644 index 5a914a9..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/7EC5EA7B +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "7,70", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/7F8B6960 b/.Rproj.user/3992D3D4/sources/prop/7F8B6960 deleted file mode 100644 index 3326078..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/7F8B6960 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "9,37", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/80CD3E7A b/.Rproj.user/3992D3D4/sources/prop/80CD3E7A deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/80CD3E7A +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/847F629C b/.Rproj.user/3992D3D4/sources/prop/847F629C deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/847F629C +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/86C3D5DC b/.Rproj.user/3992D3D4/sources/prop/86C3D5DC deleted file mode 100644 index 75052c4..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/86C3D5DC +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cursorPosition": "141,38", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/8DF4A0BB b/.Rproj.user/3992D3D4/sources/prop/8DF4A0BB deleted file mode 100644 index d61b10c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/8DF4A0BB +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "1,31", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/8E74A7E8 b/.Rproj.user/3992D3D4/sources/prop/8E74A7E8 deleted file mode 100644 index 8a3bd6d..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/8E74A7E8 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "5,24", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/8F7C148B b/.Rproj.user/3992D3D4/sources/prop/8F7C148B deleted file mode 100644 index 5d64f5c..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/8F7C148B +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "14,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/97399623 b/.Rproj.user/3992D3D4/sources/prop/97399623 deleted file mode 100644 index 51ec28a..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/97399623 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "17,17", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/AA8888B6 b/.Rproj.user/3992D3D4/sources/prop/AA8888B6 deleted file mode 100644 index ded1a4a..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/AA8888B6 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "7,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/ADDA4E66 b/.Rproj.user/3992D3D4/sources/prop/ADDA4E66 deleted file mode 100644 index eb38e5f..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/ADDA4E66 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "43,31", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/B6F436B8 b/.Rproj.user/3992D3D4/sources/prop/B6F436B8 deleted file mode 100644 index 54b10b3..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/B6F436B8 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "10,26", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/BAAC6886 b/.Rproj.user/3992D3D4/sources/prop/BAAC6886 deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/BAAC6886 +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/C361053E b/.Rproj.user/3992D3D4/sources/prop/C361053E deleted file mode 100644 index fc09239..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/C361053E +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "39,65", - "scrollLine": "29" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/C7D401C2 b/.Rproj.user/3992D3D4/sources/prop/C7D401C2 deleted file mode 100644 index db3bd25..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/C7D401C2 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled2", - "cursorPosition": "7,70", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/CEE0A27E b/.Rproj.user/3992D3D4/sources/prop/CEE0A27E deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/CEE0A27E +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/D1765424 b/.Rproj.user/3992D3D4/sources/prop/D1765424 deleted file mode 100644 index 72ddad9..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/D1765424 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "68,17", - "scrollLine": "0", - "last_setup_crc32": "" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/ECE0FFE8 b/.Rproj.user/3992D3D4/sources/prop/ECE0FFE8 deleted file mode 100644 index a1be1af..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/ECE0FFE8 +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cursorPosition": "3,14", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/EE17ED8B b/.Rproj.user/3992D3D4/sources/prop/EE17ED8B deleted file mode 100644 index 98616c4..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/EE17ED8B +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cursorPosition": "18,10", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/EF1AA608 b/.Rproj.user/3992D3D4/sources/prop/EF1AA608 deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/EF1AA608 +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/F2054525 b/.Rproj.user/3992D3D4/sources/prop/F2054525 deleted file mode 100644 index 9e26dfe..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/F2054525 +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/F41F9CA2 b/.Rproj.user/3992D3D4/sources/prop/F41F9CA2 deleted file mode 100644 index ca9cb6f..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/F41F9CA2 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "7,5", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 b/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 deleted file mode 100644 index b6ae5cb..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tempName": "Untitled1", - "cursorPosition": "22,17", - "scrollLine": "0" -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/INDEX b/.Rproj.user/3992D3D4/sources/prop/INDEX deleted file mode 100644 index b3c6ba9..0000000 --- a/.Rproj.user/3992D3D4/sources/prop/INDEX +++ /dev/null @@ -1,37 +0,0 @@ -H%3A%2FUbuntuRv2%2FGibbs-sampler-algorithm%2FMA-Tingjin5%2Fsimu_case1_EBMA8_log_0.R="CEE0A27E" -H%3A%2FUbuntuRv2%2FGibbs-sampler-algorithm%2FMA-Tingjin5%2Fsimu_case2_log_AoS.R="86C3D5DC" -H%3A%2FUbuntuRv2%2FGibbs-sampler-algorithm%2FMA-Tingjin5%2Fsimu_case2_log_AoS.Rout="6B6242EF" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2F.Rbuildignore="80CD3E7A" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FDESCRIPTION="ECE0FFE8" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FLICENSE="F2054525" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FLICENSE.R="8DF4A0BB" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FNAMESPACE="23F6439F" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2FAICc.R="352966FF" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Facceptanceratio.R="7F8B6960" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fblockgibbs.R="C7D401C2" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fblockgibbs1.R="5380A78C" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fblockgibbs2.R="63A0B237" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fblockgibbs3.R="C361053E" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fburnseq.R="3AA9A4FC" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2FexBIC.R="25B3AAD6" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fgibbs.R="7EC5EA7B" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fgibbs1.R="8F7C148B" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fhello.R="EE17ED8B" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fichart.R="7C8C31A9" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fplotgibbs.R="F41F9CA2" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fpredgibbs.R="6ADD8893" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Freorder.R="B6F436B8" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fresultgibbs.R="ADDA4E66" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fsicvalue.R="4CFCE487" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fsigmoid.R="8E74A7E8" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2FR%2Fweight.R="36CC97DB" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2Fman%2FAICc.Rd="847F629C" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2Fman%2Fac.ratio.Rd="EF1AA608" -H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2Fman%2FexBIC.Rd="BAAC6886" -H%3A%2FUbuntuRv2%2FIBGS%2Ftest.R="FCD88EE5" -H%3A%2FUbuntuRv2%2FIBGS%2Ftest.Rout="43B20C7B" -H%3A%2FUbuntuRv2%2FIBGS%2Ftest1.R="97399623" -H%3A%2FUbuntuRv2%2FIBGS%2Ftest1.Rout="354CB43F" -H%3A%2FUbuntuRv2%2FTCGS%2FIBGS.Rmd="D1765424" -H%3A%2FUbuntuRv2%2FTCGS%2FIBGS.tex="4F1C9B07" -H%3A%2FUbuntuRv2%2FTCGS%2Ftcg_ar.R="AA8888B6" diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/088D3205 b/.Rproj.user/3992D3D4/sources/s-54CE4874/088D3205 deleted file mode 100644 index 2c5e2d5..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/088D3205 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "088D3205", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/plotgibbs.R", - "project_path": "R/plotgibbs.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637718683116.0, - "source_on_save": false, - "relative_order": 8, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "7,5", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637242326, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637242326, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/24ECBBFE-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/24ECBBFE-contents deleted file mode 100644 index 69f4768..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/24ECBBFE-contents +++ /dev/null @@ -1,52 +0,0 @@ -#' a summary of partial results -#' -#' @param m.matrix a matrix of generated samples -#' @param y the response variable -#' @param x the predictors -#' @param n.models the number of top selected models -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param k the tuning parameter -#' @param gamma the tuning parameter to control the penalty -#' @param p0 the number of total predictors -#' -#' @return a list containing partial results -#' @export - -result.GibbsSampler <- function(m.matrix, y, x, k, gamma, p0, n.models, info, family){ - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - - n <- dim(m.matrix)[1] - m.sic <- vector() - for(i in 1:n){ - m.sic <- c(m.sic, v.sic(m.matrix[i,], y, x, gamma, p0, info, family)) - } - - m.sic.df <- as.data.frame(table(m.sic)) - m.sics <- as.numeric(levels(m.sic.df[,1])) - - if(length(m.sics) < n.models) - n.models <- length(m.sics) - - m.order <- order(m.sic, decreasing = FALSE) - m.index <- cumsum(m.sic.df[,2]) - m.models <- list() - for (i in 1:n.models) { - model <- glm(y~., z[,m.matrix[m.order[m.index[i]],]==1], family = family) - m.models[[i]] <- model - } - m.sicc <- m.sics[1:n.models] - m.weights <- weight(m.sicc, k) - - return(list(n.models = n.models, - m.sics = m.sics, - m.sic = m.sic, - m.seq = m.matrix[,-1], - c.models = list(models = m.models, - weights = m.weights), - k = k, - info = info, - family = family - )) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/2856D250-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/2856D250-contents deleted file mode 100644 index ba459e5..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/2856D250-contents +++ /dev/null @@ -1,50 +0,0 @@ -#' The second step in the block Gibbs sampler search algorithm in the iterations -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model - -#' @return the number of selected columns -#' @export - -BlockGibbsSampler.step2 <- function(y, x1, x2, H, kapp, tau, len, - k, gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - - s.index <- rep(1, p.s) - m.matrix <- GibbsSamplerStep(y, x.s, x2 = vector(), s.index, len, - k, gamma, p0, info, family) - v.freq2 <- colSums(m.matrix)/len - - if(sum(v.freq2[-1] > tau) > 1){ - v.select <- as.numeric(colnames(x.s)[v.freq2[-1] > tau]) - } - else{ - v.select <- as.numeric(colnames(x.s)) - } - return(sort(v.select)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/3A7AE6B8-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/3A7AE6B8-contents deleted file mode 100644 index 0540808..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/3A7AE6B8-contents +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by roxygen2: do not edit by hand - -export(AICc) -export(BlockGibbsSampler) -export(BlockGibbsSampler.step1) -export(BlockGibbsSampler.step2) -export(BlockGibbsSampler.step3) -export(GibbsSamplerStep) -export(ac.ratio) -export(burn.seq) -export(exBIC) -export(plots.Gibbs) -export(predicts.Gibbs) -export(r.index) -export(result.GibbsSampler) -export(sigmoid) -export(v.sic) -export(weight) diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785 b/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785 deleted file mode 100644 index 32f4eb6..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "4CA67785", - "path": "H:/UbuntuRv2/IBGS/test1.R", - "project_path": null, - "type": "r_source", - "hash": "2176420345", - "contents": "", - "dirty": false, - "created": 1637716901605.0, - "source_on_save": false, - "relative_order": 12, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "17,17", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637716979, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637716979135, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785-contents deleted file mode 100644 index cd7bbdb..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/4CA67785-contents +++ /dev/null @@ -1,23 +0,0 @@ -library(IBGS) -library(doParallel) - -setwd("/mnt/h/UbuntuRv2/IBGS") - -#parallel setting -registerDoParallel(10) -set.seed(101) - -n <- 500 -p <- 50 - -x <- matrix(rnorm(n*p), ncol = p) -colnames(x) <- 1:p - -y <- rowSums(x[,1:5]) + rnorm(p) -m.l1 <- GibbsSampler(y,x, info = "BIC", family = "gaussian") -save.image("test1.RData") - -w <- exp(2+y)/(1+exp(2+y)) -s <- rbinom(n, 1, w) -m.s1 <- GibbsSampler(w,x, info = "BIC", family = "binomial") -save.image("test1.RData") diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/57586E8E-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/57586E8E-contents deleted file mode 100644 index c0750b6..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/57586E8E-contents +++ /dev/null @@ -1,49 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 250 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models = 10, H = 30, kapp = 20, - tau = 0.9, len = 250, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - result$x.predictors <- x.predictors - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B b/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B deleted file mode 100644 index 01c93b1..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "7873540B", - "path": null, - "project_path": null, - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": true, - "created": 1637612583523.0, - "source_on_save": false, - "relative_order": 7, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "118,41", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1640017352048, - "encoding": "", - "collab_server": "", - "source_window": "", - "last_content_update": 1637613845862, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B-contents deleted file mode 100644 index b69e424..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/7873540B-contents +++ /dev/null @@ -1,139 +0,0 @@ -### linear case 1 - (CV-MA) -#ensure empty environment -rm(list = ls()) - -library(pROC) -library(MASS) - -set.seed(101) -#set up working directory -setwd("/mnt/h/UbuntuRv2/Gibbs-sampler-algorithm/MA-Tingjin5") - -set.seed(101) - -#simulation set up -#200 train samples and 200 test samples with 1000 predictors -n <- 500 -p <- 1000 -rho <- 0.5 - -#correlation matrix -#correlation between any two predictors is 0.5 except x4,x5 -M1 <- rho + (1-rho)*diag(p/2) - -#correlation between x4 and others is 1/sqrt(0.5) except x5 -M1[,4] <- 1/sqrt(2) -M1[4,] <- 1/sqrt(2) -M1[4,4] <- 1 - -M2 <- diag(1,p/2) -for (i in 1:p/2) -{ - for (j in 1:i) - { - M2[j,i] <- rho^{i-j} - M2[i,j] <- M2[j,i] - } -} - -#coefficients -#with 4 preselected equal = 1 and others are randomly generated from N(0,1) -s <- 10 -beta <- 2*c(1,1,1,1,1, rnorm(s-5)) - -AUC <- vector() - -j <- 0 -while(j < 100){ - - #data matrix - x1 <- mvrnorm(n,rep(0,p/2),M1) - x2 <- mvrnorm(n,rep(0,p/2),M2) - AX <- cbind(x1,x2) - - w <- AX[,c(1:4,1:6+p/2)]%*%beta + 3*sin(rnorm(n)*pi) + 3*cos(rnorm(n)*pi) - q <- exp(w)/(1+exp(w)) - y <- rbinom(n,1,q) - - p <- PP <- ncol(AX) - - ###################################### - - COV <- rep(0,len=PP) - - for(i in 1:PP){ - fit <- glm(y~AX[,i],family=binomial()) - COV[i] <- (summary(fit)$coefficients)[2,4] - } - - a <- cbind(1:PP,COV) - COV <- a[order(a[,2],decreasing=F),1:2] - #print(COV) - - NN <- NumbPred <- 10 #The number of predictors - - #KK <- trunc(sum(COV[,2]<=0.01)/NN) - KK <- 10 - print(c(NN,KK)) - - ###################################### - - Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK) - - COM <- 1 - USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) - - for(i in 1:n){ - fit <- glm(y[-i]~E[-i,]+0,binomial(link="logit")) - Pred[i,COM] <- sum( E[i,]*(fit$coefficients) ) - } - - fit <- glm(y~E+0,binomial(link="logit")) - PRED[,COM] <- E%*%(fit$coefficients) - - for(m in 2:KK){ - - COM <- m - USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) - - for(i in 1:n){ - fit <- glm(y[-i]~E[-i,]+0,binomial(link="logit")) - Pred[i,COM] <- sum( E[i,]*(fit$coefficients) ) - } - - fit <- glm(y~E+0,binomial(link="logit")) - PRED[,COM] <- E%*%(fit$coefficients) - - } - - ###################################### - - w <- rep(0.5,len=KK) - - print(head(Pred)) - - print(auc(y, Pred[,1])) - print(auc(y, Pred[,2])) - - Stein <- function(w){ - Pi <- exp(Pred%*%w)/(1+exp(Pred%*%w)) - ss <- -sum( y*log(Pi)+(1-y)*log(1-Pi) ) - ss - } - - model <- optim(w,fn=Stein,method="L-BFGS-B",lower=rep(0,len=m),upper=rep(1,len=m)) - - w <- model$par - - ###################################### - - Pred <- PRED%*%w - EProb <- exp(Pred)/(1+exp(Pred)) - - AUC <- c(AUC, auc(y, EProb)) - - j <- j+1 - print(j) -} - -save.image("simu_case2_log_AoS.RData") \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3 b/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3 deleted file mode 100644 index b6ad18a..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "78CE84F3", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs3.R", - "project_path": "R/blockgibbs3.R", - "type": "r_source", - "hash": "3794294460", - "contents": "", - "dirty": false, - "created": 1637731589587.0, - "source_on_save": false, - "relative_order": 9, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "39,65", - "scrollLine": "29" - }, - "folds": "", - "lastKnownWriteTime": 1637731599, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637731599035, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3-contents deleted file mode 100644 index 876a80c..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/78CE84F3-contents +++ /dev/null @@ -1,53 +0,0 @@ -#' Title -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param n.models the number of top selected models -#' @param x.predictors the names of predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a list containg all results -#' @export - -BlockGibbsSampler.step3 <- function(y, x1, x2, n.models, x.predictors, H, kapp, tau, len, k, - gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - s.index <- rep(1, p.s) - m.matrix <- GibbsSamplerStep(y, x.s, x2 = vector(), s.index, 4*len, k, gamma, p0, info, family) - - result <- result.GibbsSampler(m.matrix, y, x.s, k, gamma, p0, n.models, info, family) - - v.prob <- rep(0, p1+p2) - v.prob[as.numeric(colnames(x.s))] <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475 b/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475 deleted file mode 100644 index 4558f7b..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "7CE9D475", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/gibbs.R", - "project_path": "R/gibbs.R", - "type": "r_source", - "hash": "1167666227", - "contents": "", - "dirty": false, - "created": 1637713818188.0, - "source_on_save": false, - "relative_order": 4, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "7,70", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637731629, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637731629636, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475-contents deleted file mode 100644 index 36947da..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/7CE9D475-contents +++ /dev/null @@ -1,85 +0,0 @@ -#' The Metropolized restricted Gibbs sampler -#' -#' @param y the response variable -#' @param x the predictors -#' @param n.vars the number of maximal predictors included in the candidate model -#' @param n.models the number of top selected models -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 1000 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' -#' @return a list of summary -#' @export - -#' @examples -#' x <- matrix(rnorm(1000), ncol = 10); -#' y <- rowSums(x[,1:5]) + rnorm(100) -#' m.s <- GibbsSampler(y,x,info = "BIC", family = "gaussian") -#' - -GibbsSampler <- function(y, x, n.vars = ncol(x), n.models = 10, - tau = 0.9, len = 1000, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - - n <- dim(x)[1] - p <- dim(x)[2] - - x.predictors <- colnames(x) - colnames(x) <- 1:p - - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - - s.index <- c(rep(1,n.vars), rep(0, n - n.vars)) - m.models <- c(1, s.index) - m.temp <- glm(y ~ .,family = family, data = z[,c(1,s.index)==1]) - - j <- 0 - while(j < 2*len){ - for(i in 1:p){ - t.index <- s.index - d.index <- t.index - d.index[i] <- 1 - t.index[i] - - if(0 < sum(d.index) & sum(d.index) <= n.vars){ - m.curr <- m.temp - m.next <- glm(y ~ .,family = family, data = z[,c(1,d.index)==1]) - - A <- ac.ratio(m.curr, m.next, k, gamma, p, info = info) - mu <- runif(1) - if(mu < A){ - t.index[i] <- 1 - t.index[i] - m.temp <- m.next - } - else{ - m.temp <- m.curr - } - s.index <- t.index - } - else{ - s.index <- t.index - } - } - - #store the sequence in a matrix - m.models <- rbind(m.models, c(1,s.index)) - j <- j + 1 - } - m.matrix <- burn.seq(m.models, len) - - result <- result.GibbsSampler(m.matrix, y, x, k, gamma, - p, n.models, info, family) - - v.prob <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/85AF2251-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/85AF2251-contents deleted file mode 100644 index b11607a..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/85AF2251-contents +++ /dev/null @@ -1,42 +0,0 @@ - -R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -[Previously saved workspace restored] - -> library(IBGS) -> library(doParallel) -Loading required package: foreach -Loading required package: iterators -Loading required package: parallel -> -> setwd("/mnt/h/UbuntuRv2/IBGS") -> -> #parallel setting -> registerDoParallel(10) -> set.seed(101) -> -> n <- 500 -> p <- 50 -> -> x <- matrix(rnorm(n*p), ncol = p) -> colnames(x) <- 1:p -> -> y <- rowSums(x[,1:5]) + rnorm(p) -> m.l1 <- GibbsSampler(y,x, info = "BIC", family = "gaussian") -Error in GibbsSampler(y, x, info = "BIC", family = "gaussian") : - could not find function "GibbsSampler" -Execution halted diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/8B86B8B0-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/8B86B8B0-contents deleted file mode 100644 index f055439..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/8B86B8B0-contents +++ /dev/null @@ -1,49 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 200 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models = 10, H = 30, kapp = 20, - tau = 0.9, len = 250, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - result$x.predictors <- x.predictors - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/94B44AE0-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/94B44AE0-contents deleted file mode 100644 index f970f84..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/94B44AE0-contents +++ /dev/null @@ -1,53 +0,0 @@ -#' Title -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param n.models the number of top selected models -#' @param x.predictors the names of predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a list containg all results -#' @export - -BlockGibbsSampler.step3 <- function(y, x1, x2, n.models, x.predictors, H, kapp, tau, len, k, - gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - s.index <- rep(1, p.s) - m.matrix <- GibbsSamplerStep(y, x.s, x2 = vector(), s.index, 2*len, k, gamma, p0, info, family) - - result <- result.GibbsSampler(m.matrix, y, x.s, k, gamma, p0, n.models, info, family) - - v.prob <- rep(0, p1+p2) - v.prob[as.numeric(colnames(x.s))] <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/A84E6ABC-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/A84E6ABC-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/BF4BF218-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/BF4BF218-contents deleted file mode 100644 index d632e15..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/BF4BF218-contents +++ /dev/null @@ -1,63 +0,0 @@ -#' Gibbs sampler search algorithm -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param s.model the start model -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a matrix of generated candidate model samples -#' @export -#' -GibbsSamplerStep <- function(y, x1, x2, s.model, len, k, gamma, p0, info, family){ - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - s.index <- c(s.model, rep(1,p2)) - m.models <- c(1, s.index) - m.temp <- glm(y ~ .,family = family, data = z[,c(1,s.index)==1]) - - j <- 0 - while(j < 2*len){ - for(i in 1:p1){ - t.index <- s.index - d.index <- t.index - d.index[i] <- 1 - t.index[i] - - if(0 < sum(d.index)){ - m.curr <- m.temp - m.next <- glm(y ~ .,family = family, data = z[,c(1,d.index)==1]) - - A <- ac.ratio(m.curr, m.next, k, gamma, p0, info = info) - mu <- runif(1) - if(mu < A){ - t.index[i] <- 1 - t.index[i] - m.temp <- m.next - } - else{ - m.temp <- m.curr - } - s.index <- t.index - } - else{ - s.index <- t.index - } - } - - #store the sequence in a matrix - m.models <- rbind(m.models, c(1,s.index)) - j <- j + 1 - } - return(burn.seq(m.models, len)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/CB089875-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/CB089875-contents deleted file mode 100644 index 20132c1..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/CB089875-contents +++ /dev/null @@ -1,29 +0,0 @@ -#' The first step in the block Gibbs sampler search algorithm -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param h the number of small groups -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model - -#' @return the marginal probability for each predictor -#' @export - -BlockGibbsSampler.step1 <- function(y, x1, x2, h, len, k, gamma, p0, info, family){ - index <- sample(x = h, size = dim(x1)[2], replace = TRUE, prob = rep(1/h, h)) - - v.freq <- foreach(i = 1:h, .combine=c) %dopar% { - xi <- x1[, index == i] - pi <- dim(xi)[2] - s.model <- rep(1,pi) - m.matrix <- GibbsSamplerStep(y, xi, x2, s.model, len, k, gamma, p0, info, family) - v.prob <- colSums(m.matrix)/len - v.prob[2:(pi+1)] - } - return(r.index(v.freq, index, h)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/D5947A0F-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/D5947A0F-contents deleted file mode 100644 index 5141e59..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/D5947A0F-contents +++ /dev/null @@ -1,12 +0,0 @@ -Package: IBGS -Type: Package -Title: Variable selection in ultrahigh dimensions using Gibbs sampler -Version: 0.1.2 -Author: Lizhong Chen -Maintainer: Lizhong Chen -Description: This package provides the iterated block Gibbs sampler, called IBGS, to solve the variable selection problem in ultrahigh dimensions. -License: GPL (>= 2) -Encoding: UTF-8 -LazyData: true -Imports: doParallel -RoxygenNote: 7.1.2 diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA b/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA deleted file mode 100644 index 08089f0..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "D7ECB8CA", - "path": null, - "project_path": null, - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": true, - "created": 1637551610452.0, - "source_on_save": false, - "relative_order": 6, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "82,20", - "scrollLine": "70" - }, - "folds": "", - "lastKnownWriteTime": 1636519728, - "encoding": "", - "collab_server": "", - "source_window": "", - "last_content_update": 1637612629812, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA-contents deleted file mode 100644 index c0fdf89..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/D7ECB8CA-contents +++ /dev/null @@ -1,105 +0,0 @@ -library(pROC) -set.seed(101) - -tcg <- read.csv("TC_data_12h_AR_Matched.csv") -z1 <- tcg[,8:157] - -z <- z1[,!(colnames(z1) == "Coriolis_parameter_absolute")] - -y <- z$y -x <- as.matrix(z[,-1]) - -n <- dim(x)[1] -p <- dim(x)[2] - -index_train <- sample(x = 2, size = n, replace = TRUE, prob = c(0.8,0.2)) - -x_train <- x[index_train == 1, ] -y_train <- y[index_train == 1 ] - -x_test <- x[index_train == 2, ] -y_test <- y[index_train == 2 ] - -AX <- x_train -y <- y_train -y.t <- y_test - -p <- PP <- ncol(AX) -n <- dim(AX)[1] -n1 <- dim(x_test)[1] - -###################################### - -COV <- rep(0,len=PP) - -for(i in 1:PP){ - fit <- glm(y~AX[,i],family=binomial()) - COV[i] <- (summary(fit)$coefficients)[2,4] -} - -a <- cbind(1:PP,COV) -COV <- a[order(a[,2],decreasing=F),1:2] -#print(COV) - -NN <- NumbPred <- 10 #The number of predictors - -KK <- trunc(sum(COV[,2]<=0.01)/NN) -#KK <- 10 - -###################################### - -Pred <- matrix(0,n,KK); PRED <- matrix(0,n,KK); PRED.t <- matrix(0,n1,KK) - -COM <- 1 -USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]); E.t <- as.matrix(x_test[,USE]) - -for(i in 1:n){ - fit <- glm(y[-i]~E[-i,],binomial(link="logit")) - Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients)) - #print(i) -} - -fit <- glm(y~E,binomial(link="logit")) -PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) -PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) - -for(m in 2:KK){ - - COM <- m - USE <- COV[(NN*(COM-1)+1):(NN*COM),1]; E <- as.matrix(AX[,USE]) - - for(i in 1:n){ - fit <- glm(y[-i]~E[-i,],binomial(link="logit")) - Pred[i,COM] <- sum( c(1,E[i,])*(fit$coefficients) ) - } - - fit <- glm(y~E,binomial(link="logit")) - PRED[,COM] <- cbind(1,E)%*%(fit$coefficients) - PRED.t[,COM] <- cbind(1,E.t)%*%(fit$coefficients) -} - -###################################### - -w <- rep(0.5,len=KK) - -print(auc(y, Pred[,1])) -print(auc(y, Pred[,2])) - -Stein <- function(w){ - Pi <- exp(Pred%*%w)/(1+exp(Pred%*%w)) - ss <- -sum( y*log(Pi)+(1-y)*log(1-Pi) ) - ss -} - -model <- optim(w,fn=Stein,method="L-BFGS-B",lower=rep(0,len=m),upper=rep(1,len=m)) - -w <- model$par - -###################################### - -Pred.0 <- PRED%*%w -Pred.t <- PRED.t%*%w -EProb <- exp(Pred)/(1+exp(Pred)) - -print(auc(y, as.vector(Pred.0))) -print(auc(y.t, as.vector(Pred.t))) diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/E70C6D4E-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/E70C6D4E-contents deleted file mode 100644 index d632e15..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/E70C6D4E-contents +++ /dev/null @@ -1,63 +0,0 @@ -#' Gibbs sampler search algorithm -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param s.model the start model -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a matrix of generated candidate model samples -#' @export -#' -GibbsSamplerStep <- function(y, x1, x2, s.model, len, k, gamma, p0, info, family){ - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - s.index <- c(s.model, rep(1,p2)) - m.models <- c(1, s.index) - m.temp <- glm(y ~ .,family = family, data = z[,c(1,s.index)==1]) - - j <- 0 - while(j < 2*len){ - for(i in 1:p1){ - t.index <- s.index - d.index <- t.index - d.index[i] <- 1 - t.index[i] - - if(0 < sum(d.index)){ - m.curr <- m.temp - m.next <- glm(y ~ .,family = family, data = z[,c(1,d.index)==1]) - - A <- ac.ratio(m.curr, m.next, k, gamma, p0, info = info) - mu <- runif(1) - if(mu < A){ - t.index[i] <- 1 - t.index[i] - m.temp <- m.next - } - else{ - m.temp <- m.curr - } - s.index <- t.index - } - else{ - s.index <- t.index - } - } - - #store the sequence in a matrix - m.models <- rbind(m.models, c(1,s.index)) - j <- j + 1 - } - return(burn.seq(m.models, len)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/F32FF4B2-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/F32FF4B2-contents deleted file mode 100644 index 84774f2..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/F32FF4B2-contents +++ /dev/null @@ -1,20 +0,0 @@ -ichart.Gibbs <- function(result){ - v <- result$m.sic - n <- length(v) - n.half <- n/2 - - v.min <- min(v) - v.sd <- sd(v) - v.mean <- mean(v) - v.upper <- v.min + sqrt(10)*sqrt(v.sd^2 + (v.mean - v.min)^2) - - v.min.half <- min(v[1:n.half]) - v.sd.half <- sd(v[1:n.half]) - v.mean.half <- mean(v[1:n.half]) - v.upper.half <- v.min.half + sqrt(10)*sqrt(v.sd.half^2 + (v.mean.half - v.min.half)^2) - - plot(1:n, v, type = "l", xlab = "Generations", ylab = paste(result$info, "Values"), - main = paste("I-chart for the generated", result$info, "sequence")) - lines(1:n.half, rep(v.upper.half, n.half), col = "red", lty = 3 ) - lines(1:n, rep(v.upper, n), col = "blue", lty = 2 ) -} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/F8F1ED40-contents b/.Rproj.user/3992D3D4/sources/s-54CE4874/F8F1ED40-contents deleted file mode 100644 index b11607a..0000000 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/F8F1ED40-contents +++ /dev/null @@ -1,42 +0,0 @@ - -R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -[Previously saved workspace restored] - -> library(IBGS) -> library(doParallel) -Loading required package: foreach -Loading required package: iterators -Loading required package: parallel -> -> setwd("/mnt/h/UbuntuRv2/IBGS") -> -> #parallel setting -> registerDoParallel(10) -> set.seed(101) -> -> n <- 500 -> p <- 50 -> -> x <- matrix(rnorm(n*p), ncol = p) -> colnames(x) <- 1:p -> -> y <- rowSums(x[,1:5]) + rnorm(p) -> m.l1 <- GibbsSampler(y,x, info = "BIC", family = "gaussian") -Error in GibbsSampler(y, x, info = "BIC", family = "gaussian") : - could not find function "GibbsSampler" -Execution halted diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/lock_file b/.Rproj.user/3992D3D4/sources/s-54CE4874/lock_file deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/0BB553A0-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/0BB553A0-contents deleted file mode 100644 index 37dda13..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/0BB553A0-contents +++ /dev/null @@ -1,53 +0,0 @@ -#' Title -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param n.models the number of top selected models -#' @param x.predictors the names of predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a list containg all results -#' @export - -BlockGibbsSampler.step3 <- function(y, x1, x2, n.models, x.predictors, H, kapp, tau, len, k, - gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - s.index <- rep(1, p.s) - m.matrix <- GibbsSampler(y, x.s, x2 = vector(), s.index, len, k, gamma, p0, info, family) - - result <- result.GibbsSampler(m.matrix, y, x.s, n.models, info, family) - - v.prob <- rep(0, p1+p2) - v.prob[as.numeric(colnames(x.s))] <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/0C641D94-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/0C641D94-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/142B84EE-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/142B84EE-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F deleted file mode 100644 index f4ae53f..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "1746EC9F", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/predgibbs.R", - "project_path": "R/predgibbs.R", - "type": "r_source", - "hash": "423377933", - "contents": "", - "dirty": false, - "created": 1637240761311.0, - "source_on_save": false, - "relative_order": 9, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "9,8", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637242321, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637242321494, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F-contents deleted file mode 100644 index ee18f39..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1746EC9F-contents +++ /dev/null @@ -1,25 +0,0 @@ -#' The prediction of the best model and model averaging over top models -#' -#' @param xnew the new data -#' @param result the result from IBGS -#' @param n.models the number of the top models -#' -#' @return the prediction values -#' @export - -predicts.Gibbs <- function(xnew, result, n.models = 1){ - m.weight <- weight(result$m.sics[1:n.models], result$k) - l.pred <- vector() - for(i in 1:n.models){ - fit <- result$c.models$models[[i]] - v.s <- as.numeric(colnames(fit$model)[-1]) - l.pred <- cbind(l.pred, as.matrix(cbind(1,xnew[,v.s]))%*% fit$coefficients) - } - wl.pred <- l.pred %*% m.weight - - y.pred <- switch(result$c.models$models[[1]]$family$family, - gaussian = wl.pred, - binomial = exp(wl.pred)/(1+exp(wl.pred)), - poisson = exp(wl.pred)) - return(y.pred) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/19D42942-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/19D42942-contents deleted file mode 100644 index 6151062..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/19D42942-contents +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by roxygen2: do not edit by hand - -export(AICc) -export(BlockGibbsSampler) -export(BlockGibbsSampler.step1) -export(BlockGibbsSampler.step2) -export(BlockGibbsSampler.step3) -export(GibbsSampler) -export(ac.ratio) -export(burn.seq) -export(exBIC) -export(r.index) -export(result.GibbsSampler) -export(sigmoid) -export(v.sic) -export(weight) diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1E3E404A-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1E3E404A-contents deleted file mode 100644 index db32b64..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1E3E404A-contents +++ /dev/null @@ -1,53 +0,0 @@ - -R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -[Previously saved workspace restored] - -> library(IBGS) -> library(doParallel) -Loading required package: foreach -Loading required package: iterators -Loading required package: parallel -> -> setwd("/mnt/h/UbuntuRv2/IBGS") -> -> #parallel setting -> registerDoParallel(10) -> set.seed(101) -> -> n <- 500 -> p <- 500 -> -> x <- matrix(rnorm(n*p), ncol = p) -> colnames(x) <- 1:p -> -> y <- rowSums(x[,1:5]) + rnorm(p) -> m.l1 <- BlockGibbsSampler(y,x, info = "BIC", family = "gaussian") -> m.l2 <- BlockGibbsSampler(y,x, info = "exBIC", family = "gaussian") -> save.image("test.RData") -> -> w <- exp(2+y)/(1+exp(2+y)) -> s <- rbinom(n, 1, w) -> m.s1 <- BlockGibbsSampler(w,x, info = "BIC", family = "binomial") -There were 50 or more warnings (use warnings() to see the first 50) -> m.s2 <- BlockGibbsSampler(w,x, info = "exBIC", family = "binomial") -There were 50 or more warnings (use warnings() to see the first 50) -> save.image("test.RData") -> -> proc.time() - user system elapsed -4804.608 21.312 814.709 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A deleted file mode 100644 index b14559d..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "1FFCF13A", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/resultgibbs.R", - "project_path": "R/resultgibbs.R", - "type": "r_source", - "hash": "1888116627", - "contents": "", - "dirty": false, - "created": 1637239808567.0, - "source_on_save": false, - "relative_order": 7, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "46,27", - "scrollLine": "26" - }, - "folds": "", - "lastKnownWriteTime": 1637241185, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637241185308, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A-contents deleted file mode 100644 index 97867e9..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/1FFCF13A-contents +++ /dev/null @@ -1,51 +0,0 @@ -#' a summary of partial results -#' -#' @param m.matrix a matrix of generated samples -#' @param y the response variable -#' @param x the predictors -#' @param n.models the number of top selected models -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param k the tuning parameter -#' @param gamma the tuning parameter to control the penalty -#' @param p0 the number of total predictors -#' -#' @return a list containing partial results -#' @export - -result.GibbsSampler <- function(m.matrix, y, x, k, gamma, p0, n.models, info, family){ - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - - n <- dim(m.matrix)[1] - m.sic <- vector() - for(i in 1:n){ - m.sic <- c(m.sic, v.sic(m.matrix[i,], y, x, gamma, p0, info, family)) - } - - m.sic.df <- as.data.frame(table(m.sic)) - m.sics <- as.numeric(levels(m.sic.df[,1])) - - if(length(m.sics) < n.models) - n.models <- length(m.sics) - - m.order <- order(m.sic, decreasing = FALSE) - m.index <- cumsum(m.sic.df[,2]) - m.models <- list() - for (i in 1:n.models) { - model <- glm(y~., z[,m.matrix[m.order[m.index[i]],]==1], family = family) - m.models[[i]] <- model - } - m.sicc <- m.sics[1:n.models] - m.weights <- weight(m.sicc, k) - - return(list(n.models = n.models, - m.sics = m.sics, - m.seq = m.matrix[,-1], - c.models = list(models = m.models, - weights = m.weights), - k = k, - info = info, - family = family - )) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 deleted file mode 100644 index 1832d0f..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "254CACE3", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs.R", - "project_path": "R/blockgibbs.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637272959110.0, - "source_on_save": false, - "relative_order": 6, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "46,37", - "scrollLine": "25" - }, - "folds": "", - "lastKnownWriteTime": 1637239897, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637239897, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents deleted file mode 100644 index ec6590d..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents +++ /dev/null @@ -1,49 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 200 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - result$x.predictors <- x.predictors - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/26534912-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/26534912-contents deleted file mode 100644 index cf10252..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/26534912-contents +++ /dev/null @@ -1,24 +0,0 @@ -#' The function for model selection criterion value -#' -#' @param m.index the model index -#' @param y the response variable -#' @param x the predictors -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param gamma the tuning parameter to control the penalty -#' @param p0 the number of total predictors -#' -#' @return model selection criterion value for selected model -#' @export - -v.sic <- function(m.index, y, x, gamma, p0, info, family){ - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - SIC <- switch(info, - AIC = AIC(glm(y~., data = z[,m.index==1], family = family)), - AICc = AICc(glm(y~., data = z[,m.index==1], family = family)), - BIC = BIC(glm(y~., data = z[,m.index==1], family = family)), - exBIC = exBIC(glm(y~., data = z[,m.index==1], family = family), gamma, p0), - ) - return(SIC) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/39E35C2F-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/39E35C2F-contents deleted file mode 100644 index 746e221..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/39E35C2F-contents +++ /dev/null @@ -1,50 +0,0 @@ -#' a summary of partial results -#' -#' @param m.matrix a matrix of generated samples -#' @param y the response variable -#' @param x the predictors -#' @param n.models the number of top selected models -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param k the tuning parameter -#' @param gamma the tuning parameter to control the penalty -#' @param p0 the number of total predictors -#' -#' @return a list containing partial results -#' @export - -result.GibbsSampler <- function(m.matrix, y, x, k, gamma, p0, n.models, info, family){ - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - - n <- dim(m.matrix)[1] - m.sic <- vector() - for(i in 1:n){ - m.sic <- c(m.sic, v.sic(m.matrix[i,], y, x, gamma, p0, info, family)) - } - - m.sic.df <- as.data.frame(table(m.sic)) - m.sics <- as.numeric(levels(m.sic.df[,1])) - - if(length(m.sics) < n.models) - n.models <- length(m.sics) - - m.order <- order(m.sic, decreasing = FALSE) - m.index <- cumsum(m.sic.df[,2]) - m.models <- list() - for (i in 1:n.models) { - model <- glm(y~., z[,m.matrix[m.order[m.index[i]],]==1], family = family) - m.models[[i]] <- model - } - m.sicc <- m.sics[1:n.models] - m.weights <- weight(m.sicc, k) - - return(list(n.models = n.models, - m.sics = m.sics, - m.seq = m.matrix[,-1], - c.models = list(models = m.models, - weights = m.weights), - info = info, - family = family - )) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF deleted file mode 100644 index 283001f..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": "462FD7FF", - "path": "H:/UbuntuRv2/TCGS/IBGS.Rmd", - "project_path": null, - "type": "r_markdown", - "hash": "2363041877", - "contents": "", - "dirty": false, - "created": 1637269087029.0, - "source_on_save": false, - "relative_order": 5, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "75,17", - "scrollLine": "48", - "last_setup_crc32": "9F8C73CAbb338d19" - }, - "folds": "", - "lastKnownWriteTime": 1637272918, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637272918280, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents deleted file mode 100644 index 1ba7f15..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "An introduction to IBGS" -author: "Lizhong Chen" -date: "11/19/2021" -output: - pdf_document: default - html_document: - df_print: paged ---- - -```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE) -``` - -## Introduction - -Here is a brief introduction to the R package "IBGS". The iterated block Gibbs sampler is a powerful variable selection method in high dimensions. It is important to identify the potential predictors which has significant influence on the response variable. - -The "IBGS" package works for the generalized linear models including linear, logistic and poisson models and uses AIC, AICc, BIC, and exBIC as the model selection criterion. - -There are two main goals for "IBGS" package: - -* Identify the important predictors with the marginal probability - -* Make a prediction based on the best selected model or model averaging using top selected models - -## Install - -To install and load the "IBGS" package, use this command -```{r, echo=FALSE} -cat("install.packages(\"IBGS_0.1.0.tar.gz\", repos = NULL)\nlibrary(IBGS)") -``` - -The "IBGS" package requires "doParallel" package. Please ensure that "doParallel" package is installed and loaded, then set up the register-cores. -```{r, echo=FALSE} -cat("library(doParallel)\nregisterDoParallel(ncores)\n") -``` -where ncores is the number of CPU cores used in the calculation. - -## Main function - -The main function is -```{r, echo=FALSE} -cat("BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c(\"AIC\", \"BIC\", \"AICc\", \"exBIC\"), - family = c(\"gaussian\",\"poisson\", \"binomial\"))") -``` -For details, please use help document. -```{r, echo=FALSE} -cat("?BlockGibbsSampler") -``` - -## Example - -Here is an example to show how "IBGS" works. We use the tropical cyclone genesis data. -```{r, echo=FALSE} -load("tcg_ar.RData") -``` - -It has 1856 samples and 149 predictors. -```{r, collapse=TRUE} -dim(x) -``` -We divide the data into train and test set and use the train set ($\approx 80\%$ of data) to run "IBGS" algorithm. Then we use the test set ($\approx 20\%$ of data) to verify the results. - -The simple following command is used -```{r} -cat("model <- BlockGibbsSampler(y_train, x_train, info = \"exBIC\", family = \"binomial\")") -``` -We only need to specify the response, predictors, the model selection criterion and the model type. -### Variable ranking - -We can plot the marginal probabilities for those important predictors using plots.Gibbs command. -```{r, collapse=TRUE} -plots.Gibbs(model) -``` - diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC deleted file mode 100644 index 4e36417..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "5F434AFC", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/hello.R", - "project_path": "R/hello.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637200590772.0, - "source_on_save": false, - "relative_order": 1, - "properties": { - "cursorPosition": "18,10", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637209059, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637209059903, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC-contents deleted file mode 100644 index 2923f95..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/5F434AFC-contents +++ /dev/null @@ -1,22 +0,0 @@ -# Hello, world! -# -# This is an example function named 'hello' -# which prints 'Hello, world!'. -# -# You can learn more about package authoring with RStudio at: -# -# http://r-pkgs.had.co.nz/ -# -# Some useful keyboard shortcuts for package authoring: -# -# Install Package: 'Ctrl + Shift + B' -# Check Package: 'Ctrl + Shift + E' -# Test Package: 'Ctrl + Shift + T' - -#' Hello function -#' -#' @return hello world -#' @export -hello <- function() { - print("Hello, world!") -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/63330167-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/63330167-contents deleted file mode 100644 index 7eb0b29..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/63330167-contents +++ /dev/null @@ -1,48 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 200 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/660ECE08-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/660ECE08-contents deleted file mode 100644 index b40b8f3..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/660ECE08-contents +++ /dev/null @@ -1,70 +0,0 @@ -#' Gibbs sampler search algorithm -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param s.model the start model -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a matrix of generated candidate model samples -#' @export -#' -#' @examples -#' x <- matrix(rnorm(1000), ncol = 10); -#' y <- rowSums(x[,1:5]) + rnorm(100) -#' m.s <- GibbsSampler(y,x,x2=vector(), s.model = rep(1,10), len = 100, -#' k=1, info = "BIC", family = "gaussian") -#' print(colSums(m.s)/100) -#' -GibbsSampler <- function(y, x1, x2, s.model, len, k, gamma, p0, info, family){ - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - s.index <- c(s.model, rep(1,p2)) - m.models <- c(1, s.index) - m.temp <- glm(y ~ .,family = family, data = z[,c(1,s.index)==1]) - - j <- 0 - while(j < 2*len){ - for(i in 1:p1){ - t.index <- s.index - d.index <- t.index - d.index[i] <- 1 - t.index[i] - - if(0 < sum(d.index)){ - m.curr <- m.temp - m.next <- glm(y ~ .,family = family, data = z[,c(1,d.index)==1]) - - A <- ac.ratio(m.curr, m.next, k, gamma, p0, info = info) - mu <- runif(1) - if(mu < A){ - t.index[i] <- 1 - t.index[i] - m.temp <- m.next - } - else{ - m.temp <- m.curr - } - s.index <- t.index - } - else{ - s.index <- t.index - } - } - - #store the sequence in a matrix - m.models <- rbind(m.models, c(1,s.index)) - j <- j + 1 - } - return(burn.seq(m.models, len)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/6DA8FBCF-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/6DA8FBCF-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/753DF263-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/753DF263-contents deleted file mode 100644 index 69b2e2a..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/753DF263-contents +++ /dev/null @@ -1,12 +0,0 @@ -#' Calculate the weights based on the model selection criterion values -#' -#' @param sic a vector of model selection criterion values -#' @param k the tuning parameter -#' -#' @return a sequence of model weights -#' @export -#' -#' -weight <- function(sic, k){ - return(exp(-k*(sic - min(sic)))/sum(exp(-k*(sic - min(sic))))) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410 deleted file mode 100644 index 6a22143..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "88DC9410", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs3.R", - "project_path": "R/blockgibbs3.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637239814991.0, - "source_on_save": false, - "relative_order": 8, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "41,53", - "scrollLine": "17" - }, - "folds": "", - "lastKnownWriteTime": 1637235064, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637235064, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410-contents deleted file mode 100644 index 63d3d1e..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/88DC9410-contents +++ /dev/null @@ -1,53 +0,0 @@ -#' Title -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param n.models the number of top selected models -#' @param x.predictors the names of predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a list containg all results -#' @export - -BlockGibbsSampler.step3 <- function(y, x1, x2, n.models, x.predictors, H, kapp, tau, len, k, - gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - s.index <- rep(1, p.s) - m.matrix <- GibbsSampler(y, x.s, x2 = vector(), s.index, len, k, gamma, p0, info, family) - - result <- result.GibbsSampler(m.matrix, y, x.s, k, gamma, p0, n.models, info, family) - - v.prob <- rep(0, p1+p2) - v.prob[as.numeric(colnames(x.s))] <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D deleted file mode 100644 index 5d494d7..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "8A9A8E5D", - "path": "H:/UbuntuRv2/IBGS/IBGS/DESCRIPTION", - "project_path": "DESCRIPTION", - "type": "dcf", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637231695421.0, - "source_on_save": false, - "relative_order": 7, - "properties": { - "cursorPosition": "7,19", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637231702, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637231702753, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D-contents deleted file mode 100644 index 5c92578..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/8A9A8E5D-contents +++ /dev/null @@ -1,12 +0,0 @@ -Package: IBGS -Type: Package -Title: Variable selection in ultrahigh dimensions using Gibbs sampler -Version: 0.1.0 -Author: Lizhong Chen -Maintainer: Lizhong Chen -Description: This package provides the iterated block Gibbs sampler, called IBGS, to solve the variable selection problem in ultrahigh dimensions. -License: GPL (>= 2) -Encoding: UTF-8 -LazyData: true -Imports: doParallel -RoxygenNote: 7.1.2 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/94BB89D5-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/94BB89D5-contents deleted file mode 100644 index 1882e44..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/94BB89D5-contents +++ /dev/null @@ -1,48 +0,0 @@ - -R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -[Previously saved workspace restored] - -> library(IBGS) -> library(doParallel) -Loading required package: foreach -Loading required package: iterators -Loading required package: parallel -> -> setwd("/mnt/h/UbuntuRv2/IBGS") -> -> #parallel setting -> registerDoParallel(10) -> set.seed(101) -> -> n <- 500 -> p <- 500 -> -> x <- matrix(rnorm(n*p), ncol = p) -> colnames(x) <- 1:p -> -> y <- rowSums(x[,1:5]) + rnorm(p) -> m.l1 <- BlockGibbsSampler(y,x, info = "BIC", family = "gaussian") -> m.l2 <- BlockGibbsSampler(y,x, info = "exBIC", family = "gaussian") -> save.image("test.RData") -> -> w <- exp(2+y)/(1+exp(2+y)) -> s <- rbinom(n, 1, w) -> m.s1 <- BlockGibbsSampler(y,x, info = "BIC", family = "binomial") -Error in { : task 1 failed - "y values must be 0 <= y <= 1" -Calls: BlockGibbsSampler ... BlockGibbsSampler.step2 -> BlockGibbsSampler.step1 -> %dopar% -> -Execution halted diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/978A2B61-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/978A2B61-contents deleted file mode 100644 index 920356c..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/978A2B61-contents +++ /dev/null @@ -1,25 +0,0 @@ -YEAR: <2021> -COPYRIGHT HOLDER: - -************************************************************************ - -Copyright (c) <2021>, - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents deleted file mode 100644 index aa1d1fd..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents +++ /dev/null @@ -1,189 +0,0 @@ -% Options for packages loaded elsewhere -\PassOptionsToPackage{unicode}{hyperref} -\PassOptionsToPackage{hyphens}{url} -% -\documentclass[ -]{article} -\usepackage{lmodern} -\usepackage{amssymb,amsmath} -\usepackage{ifxetex,ifluatex} -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[T1]{fontenc} - \usepackage[utf8]{inputenc} - \usepackage{textcomp} % provide euro and other symbols -\else % if luatex or xetex - \usepackage{unicode-math} - \defaultfontfeatures{Scale=MatchLowercase} - \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} -\fi -% Use upquote if available, for straight quotes in verbatim environments -\IfFileExists{upquote.sty}{\usepackage{upquote}}{} -\IfFileExists{microtype.sty}{% use microtype if available - \usepackage[]{microtype} - \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts -}{} -\makeatletter -\@ifundefined{KOMAClassName}{% if non-KOMA class - \IfFileExists{parskip.sty}{% - \usepackage{parskip} - }{% else - \setlength{\parindent}{0pt} - \setlength{\parskip}{6pt plus 2pt minus 1pt}} -}{% if KOMA class - \KOMAoptions{parskip=half}} -\makeatother -\usepackage{xcolor} -\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} -\hypersetup{ - pdftitle={An introduction to IBGS}, - pdfauthor={Lizhong Chen}, - hidelinks, - pdfcreator={LaTeX via pandoc}} -\urlstyle{same} % disable monospaced font for URLs -\usepackage[margin=1in]{geometry} -\usepackage{color} -\usepackage{fancyvrb} -\newcommand{\VerbBar}{|} -\newcommand{\VERB}{\Verb[commandchars=\\\{\}]} -\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} -% Add ',fontsize=\small' for more characters per line -\usepackage{framed} -\definecolor{shadecolor}{RGB}{248,248,248} -\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}} -\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}} -\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} -\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}} -\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} -\newcommand{\BuiltInTok}[1]{#1} -\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} -\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} -\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} -\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} -\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} -\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} -\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} -\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} -\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}} -\newcommand{\ExtensionTok}[1]{#1} -\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} -\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} -\newcommand{\ImportTok}[1]{#1} -\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} -\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} -\newcommand{\NormalTok}[1]{#1} -\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} -\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} -\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} -\newcommand{\RegionMarkerTok}[1]{#1} -\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} -\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} -\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} -\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} -\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} -\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} -\usepackage{graphicx,grffile} -\makeatletter -\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} -\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} -\makeatother -% Scale images if necessary, so that they will not overflow the page -% margins by default, and it is still possible to overwrite the defaults -% using explicit options in \includegraphics[width, height, ...]{} -\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} -% Set default figure placement to htbp -\makeatletter -\def\fps@figure{htbp} -\makeatother -\setlength{\emergencystretch}{3em} % prevent overfull lines -\providecommand{\tightlist}{% - \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} -\setcounter{secnumdepth}{-\maxdimen} % remove section numbering - -\title{An introduction to IBGS} -\author{Lizhong Chen} -\date{11/19/2021} - -\begin{document} -\maketitle - -\hypertarget{introduction}{% -\subsection{Introduction}\label{introduction}} - -Here is a brief introduction to the R package ``IBGS''. The iterated -block Gibbs sampler is a powerful variable selection method in high -dimensions. It is important to identify the potential predictors which -has significant influence on the response variable. - -The ``IBGS'' package works for the generalized linear models including -linear, logistic and poisson models and uses AIC, AICc, BIC, and exBIC -as the model selection criterion. - -There are two main goals for ``IBGS'' package: - -\begin{itemize} -\item - Identify the important predictors with the marginal probability -\item - Make a prediction based on the best selected model or model averaging - using top selected models -\end{itemize} - -\hypertarget{install}{% -\subsection{Install}\label{install}} - -To install and load the ``IBGS'' package, use this command - -\begin{verbatim} -## install.packages("IBGS_0.1.0.tar.gz", repos = NULL) -## library(IBGS) -\end{verbatim} - -The ``IBGS'' package requires ``doParallel'' package. Please ensure that -``doParallel'' package is installed and loaded, then set up the -register-cores. - -\begin{verbatim} -## library(doParallel) -## registerDoParallel(ncores) -\end{verbatim} - -where ncores is the number of CPU cores used in the calculation. - -\hypertarget{main-function}{% -\subsection{Main function}\label{main-function}} - -The main function is - -\begin{verbatim} -## BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, -## tau = 0.9, len = 200, k = 1, gamma = 0.5, -## info = c("AIC", "BIC", "AICc", "exBIC"), -## family = c("gaussian","poisson", "binomial")) -\end{verbatim} - -For details, please use help document. - -\begin{verbatim} -## ?BlockGibbsSampler -\end{verbatim} - -\hypertarget{example}{% -\subsection{Example}\label{example}} - -Here is an example to show how ``IBGS'' works. We use the tropical -cyclone genesis data. - -It has 1856 samples and 149 predictors. - -\begin{Shaded} -\begin{Highlighting}[] -\KeywordTok{dim}\NormalTok{(x)} -\CommentTok{## [1] 1856 149} -\end{Highlighting} -\end{Shaded} - -We divide the data into train and test set and use the train set -(\$\approx\$80\% of data) - -\end{document} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A073AC50-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A073AC50-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 deleted file mode 100644 index 07bef63..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "A15EC043", - "path": "H:/UbuntuRv2/TCGS/tcg_ar.R", - "project_path": null, - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637268014092.0, - "source_on_save": false, - "relative_order": 4, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "3,7", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637268337, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637268337695, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents deleted file mode 100644 index 2457986..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents +++ /dev/null @@ -1,29 +0,0 @@ -library(IBGS) -library(doParallel) - -setwd("/mnt/h/UbuntuRv2/TCGS") - -#parallel setting -registerDoParallel(12) -set.seed(101) - -tcg <- read.csv("TC_data_12h_AR_Matched.csv") -z <- tcg[,8:157] - -y <- z$y -x <- as.matrix(z[,-1]) - -n <- dim(x)[1] -p <- dim(x)[2] - -index_train <- sample(x = 2, size = n, replace = TRUE, prob = c(0.8,0.2)) - -x_train <- x[index_train == 1, ] -y_train <- y[index_train == 1 ] - -x_test <- x[index_train == 2, ] -y_test <- y[index_train == 2 ] - -model <- BlockGibbsSampler(y_train, x_train, info = "exBIC", family = "binomial") - -save.image("tcg_ar.RData") diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C deleted file mode 100644 index 8952945..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "BDFFCD1C", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/plotgibbs.R", - "project_path": "R/plotgibbs.R", - "type": "r_source", - "hash": "1826741395", - "contents": "", - "dirty": false, - "created": 1637239538210.0, - "source_on_save": false, - "relative_order": 5, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "7,5", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637242326, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637242326181, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C-contents deleted file mode 100644 index 16efbda..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/BDFFCD1C-contents +++ /dev/null @@ -1,19 +0,0 @@ -#' plot the marginal probability for top predictors -#' -#' @param result the result from IBGS -#' @param n.vars the number of top predictors - -#' @export - -plots.Gibbs <- function(result, n.vars = 20){ - colors <- rep(0,n.vars) - v.order <- order(result$v.prob, decreasing = TRUE) - v.freq <- result$v.prob[v.order[1:n.vars]] - - colors[v.freq > result$tau] <- 2 - colors[v.freq <= result$tau ] <- 1 - plot(1:n.vars, v.freq, xlab = "", ylab = "Marginal Probability", - xaxt = "n", main = "", type = "h", col = colors, ylim = c(0,1)) - mtext(result$x.predictors[v.order[1:n.vars]], side = 1, line = 0.25, - at = 1:n.vars, las = 2, cex = 1) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C1EF0210-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C1EF0210-contents deleted file mode 100644 index 39498df..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C1EF0210-contents +++ /dev/null @@ -1,41 +0,0 @@ - -R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) - -R is free software and comes with ABSOLUTELY NO WARRANTY. -You are welcome to redistribute it under certain conditions. -Type 'license()' or 'licence()' for distribution details. - -R is a collaborative project with many contributors. -Type 'contributors()' for more information and -'citation()' on how to cite R or R packages in publications. - -Type 'demo()' for some demos, 'help()' for on-line help, or -'help.start()' for an HTML browser interface to help. -Type 'q()' to quit R. - -[Previously saved workspace restored] - -> library(IBGS) -> library(doParallel) -Loading required package: foreach -Loading required package: iterators -Loading required package: parallel -> -> setwd("/mnt/h/UbuntuRv2/IBGS") -> -> #parallel setting -> registerDoParallel(10) -> set.seed(101) -> -> x <- matrix(rnorm(50000), ncol = 500) -> colnames(x) <- 1:500 -> -> y <- rowSums(x[,1:5]) + rnorm(100) -> m.l1 <- BlockGibbsSampler(y,x, info = "BIC", family = "gaussian") -> m.l2 <- BlockGibbsSampler(y,x, info = "exBIC", family = "gaussian") -Error in exBIC(glm(y ~ ., data = z[, m.index == 1], family = family)) : - argument "gamma" is missing, with no default -Calls: BlockGibbsSampler ... BlockGibbsSampler.step3 -> result.GibbsSampler -> v.sic -> exBIC -Execution halted diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C99CC9CF-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C99CC9CF-contents deleted file mode 100644 index 63d3d1e..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/C99CC9CF-contents +++ /dev/null @@ -1,53 +0,0 @@ -#' Title -#' -#' @param y the response variable -#' @param x1 the non-important predictors -#' @param x2 the important predictors -#' @param n.models the number of top selected models -#' @param x.predictors the names of predictors -#' @param H the number of predictors in small groups -#' @param kapp the number of selected predictors in first step -#' @param tau the threshold to select the important predictors in second step -#' @param len the half number of generated samples -#' @param k the tuning parameter -#' @param gamma the parameter for extended BIC -#' @param p0 the number of all predictors -#' @param info the selected model selection criterion -#' @param family the type of model -#' -#' @return a list containg all results -#' @export - -BlockGibbsSampler.step3 <- function(y, x1, x2, n.models, x.predictors, H, kapp, tau, len, k, - gamma, p0, info, family){ - x <- cbind(x1,x2) - z <- as.data.frame(cbind(y,x1,x2)) - colnames(z)[1] <- "y" - - n <- dim(x1)[1] - p1 <- dim(x1)[2] - if(is.null(dim(x2))){ - p2 <- 0 - }else - p2 <- dim(x2)[2] - - h <- ceiling(dim(x1)[2]/(min(H, n-p2))) - v.freq <- BlockGibbsSampler.step1(y, x1, x2, h, len, k, gamma, p0, info, family) - - x.s <- cbind(x1[,order(v.freq, decreasing = TRUE)[1:kapp]], x2) - p.s <- dim(x.s)[2] - s.index <- rep(1, p.s) - m.matrix <- GibbsSampler(y, x.s, x2 = vector(), s.index, len, k, gamma, p0, info, family) - - result <- result.GibbsSampler(m.matrix, y, x.s, k, gamma, p0, n.models, info, family) - - v.prob <- rep(0, p1+p2) - v.prob[as.numeric(colnames(x.s))] <- colSums(m.matrix[,-1])/len - v.select <- x.predictors[v.prob > tau] - - result$v.prob <- v.prob - result$v.select <- v.select - result$tau <- tau - - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/CABE8B9A-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/CABE8B9A-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D58D0530-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D58D0530-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948 deleted file mode 100644 index 8ed9d15..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "D5BDC948", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/exBIC.R", - "project_path": "R/exBIC.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637234958052.0, - "source_on_save": false, - "relative_order": 10, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "11,44", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637208071, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637208071, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948-contents deleted file mode 100644 index 8cf21a0..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/D5BDC948-contents +++ /dev/null @@ -1,13 +0,0 @@ -#' extended BIC function -#' -#' @param model the selected model -#' @param gamma the tuning parameter to control the penalty -#' @param p0 the number of total predictors -#' -#' @return extended BIC value -#' @export -#' -exBIC <- function(model, gamma, p0){ - p <- model$df.null - model$df.residual - return(BIC(model)+ 2* gamma * p * log(p0)) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB deleted file mode 100644 index c816ad8..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "DD4A4CFB", - "path": "H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs.R", - "project_path": "R/blockgibbs.R", - "type": "r_source", - "hash": "1060176225", - "contents": "", - "dirty": false, - "created": 1637239832069.0, - "source_on_save": false, - "relative_order": 9, - "properties": { - "tempName": "Untitled2", - "cursorPosition": "46,37", - "scrollLine": "25" - }, - "folds": "", - "lastKnownWriteTime": 1637239897, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637239897522, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB-contents deleted file mode 100644 index ec6590d..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/DD4A4CFB-contents +++ /dev/null @@ -1,49 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 200 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - result$x.predictors <- x.predictors - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E0E1F12B-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E0E1F12B-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E0FCB66E-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E0FCB66E-contents deleted file mode 100644 index 7eb0b29..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E0FCB66E-contents +++ /dev/null @@ -1,48 +0,0 @@ -#' The iterated block Gibbs sampler algorithm -#' -#' @param y the response variable -#' @param x the predictors -#' @param H the number of predictors in small groups, default is 30 -#' @param kapp the number of selected predictors in first step, default is 20 -#' @param tau the threshold to select the important predictors in second step, default is 0.9 -#' @param len the half number of generated samples, default is 200 -#' @param k the tuning parameter, default is 1 -#' @param gamma the parameter for extended BIC, default is 0.5 -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' @param n.iter the number of iterations -#' @param n.models the number of top selected models -#' -#' @return a list contains a summary of final result -#' @export - -BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c("AIC", "BIC", "AICc", "exBIC"), - family = c("gaussian","poisson", "binomial")){ - p <- dim(x)[2] - x.predictors <- colnames(x) - colnames(x) <- 1:p - - x1 <- x - x2 <- vector() - - if(n.iter < 2){ - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - else{ - j <- 1 - while(j < n.iter){ - v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, - gamma, p, info, family) - x1 <- x[, -v.select] - x2 <- x[, v.select] - - j <- j+1 - } - result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, - kapp, tau, len, k, gamma, p, info, family) - } - return(result) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E99762E1-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/E99762E1-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB2F615D-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB2F615D-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 deleted file mode 100644 index 78675c6..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "EB3BE702", - "path": "H:/UbuntuRv2/IBGS/test.R", - "project_path": null, - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1637209496925.0, - "source_on_save": false, - "relative_order": 10, - "properties": { - "tempName": "Untitled1", - "cursorPosition": "23,8", - "scrollLine": "0" - }, - "folds": "", - "lastKnownWriteTime": 1637237719, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1637237719928, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702-contents deleted file mode 100644 index 1d3da52..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702-contents +++ /dev/null @@ -1,25 +0,0 @@ -library(IBGS) -library(doParallel) - -setwd("/mnt/h/UbuntuRv2/IBGS") - -#parallel setting -registerDoParallel(10) -set.seed(101) - -n <- 500 -p <- 500 - -x <- matrix(rnorm(n*p), ncol = p) -colnames(x) <- 1:p - -y <- rowSums(x[,1:5]) + rnorm(p) -m.l1 <- BlockGibbsSampler(y,x, info = "BIC", family = "gaussian") -m.l2 <- BlockGibbsSampler(y,x, info = "exBIC", family = "gaussian") -save.image("test.RData") - -w <- exp(2+y)/(1+exp(2+y)) -s <- rbinom(n, 1, w) -m.s1 <- BlockGibbsSampler(w,x, info = "BIC", family = "binomial") -m.s2 <- BlockGibbsSampler(w,x, info = "exBIC", family = "binomial") -save.image("test.RData") diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/F03A716A-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/F03A716A-contents deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/F0645852-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/F0645852-contents deleted file mode 100644 index c565afe..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/F0645852-contents +++ /dev/null @@ -1,22 +0,0 @@ -#' The function for model selection criterion value -#' -#' @param m.index the model index -#' @param y the response variable -#' @param x the predictors -#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC -#' @param family the type of model from linear, logistic, poisson -#' -#' @return model selection criterion value for selected model -#' @export - -v.sic <- function(m.index, y, x, info, family){ - z <- as.data.frame(cbind(y,x)) - colnames(z)[1] <- "y" - SIC <- switch(info, - AIC = AIC(glm(y~., data = z[,m.index==1], family = family)), - AICc = AICc(glm(y~., data = z[,m.index==1], family = family)), - BIC = BIC(glm(y~., data = z[,m.index==1], family = family)), - exBIC = exBIC(glm(y~., data = z[,m.index==1], family = family)), - ) - return(SIC) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/FD181623-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/FD181623-contents deleted file mode 100644 index 69b2e2a..0000000 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/FD181623-contents +++ /dev/null @@ -1,12 +0,0 @@ -#' Calculate the weights based on the model selection criterion values -#' -#' @param sic a vector of model selection criterion values -#' @param k the tuning parameter -#' -#' @return a sequence of model weights -#' @export -#' -#' -weight <- function(sic, k){ - return(exp(-k*(sic - min(sic)))/sum(exp(-k*(sic - min(sic))))) -} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/lock_file b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/lock_file deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49C10954F/chunks.json b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49C10954F/chunks.json deleted file mode 100644 index ac064a7..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49C10954F/chunks.json +++ /dev/null @@ -1 +0,0 @@ -{"chunk_definitions":[{"row":12,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"setup","include":false},"document_id":"462FD7FF","chunk_id":"csetup_chunk","chunk_label":"setup"},{"row":31,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-14"},"document_id":"462FD7FF","chunk_id":"cqmvnsw06ftmj","chunk_label":"unnamed-chunk-1"},{"row":36,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-10"},"document_id":"462FD7FF","chunk_id":"cs66fm6jqvos8","chunk_label":"unnamed-chunk-2"},{"row":47,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"c93jpyd1jmhhi","chunk_label":"unnamed-chunk-3"},{"row":51,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-30"},"document_id":"462FD7FF","chunk_id":"cz52i8jarnd8t","chunk_label":"unnamed-chunk-4"},{"row":59,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-1"},"document_id":"462FD7FF","chunk_id":"cfq06oe8jrdlh","chunk_label":"unnamed-chunk-5"},{"row":64,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-2"},"document_id":"462FD7FF","chunk_id":"c9kilm1aj7mw3","chunk_label":"unnamed-chunk-6"},{"row":70,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-3"},"document_id":"462FD7FF","chunk_id":"cubqz02zklowi","chunk_label":"unnamed-chunk-7"},{"row":78,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-4"},"document_id":"462FD7FF","chunk_id":"cjpy5g7olmz1k","chunk_label":"unnamed-chunk-8"},{"row":82,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-5"},"document_id":"462FD7FF","chunk_id":"c3y5icinxq7eg","chunk_label":"unnamed-chunk-9"},{"row":95,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-8"},"document_id":"462FD7FF","chunk_id":"cmory16znzyvn","chunk_label":"unnamed-chunk-10"},{"row":109,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"cs0ac6ddzb89k","chunk_label":"unnamed-chunk-12"}],"doc_write_time":1637274487,"chunk_rendered_width":700,"working_dir":null,"default_chunk_options":{"echo":true}} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json deleted file mode 100644 index 6f17608..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json +++ /dev/null @@ -1 +0,0 @@ -{"chunk_definitions":[{"row":12,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"setup","include":false},"document_id":"462FD7FF","chunk_id":"csetup_chunk","chunk_label":"setup"},{"row":31,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-14"},"document_id":"462FD7FF","chunk_id":"cqmvnsw06ftmj","chunk_label":"unnamed-chunk-1"},{"row":36,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-10"},"document_id":"462FD7FF","chunk_id":"cs66fm6jqvos8","chunk_label":"unnamed-chunk-2"},{"row":47,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"c93jpyd1jmhhi","chunk_label":"unnamed-chunk-3"},{"row":51,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-30"},"document_id":"462FD7FF","chunk_id":"cz52i8jarnd8t","chunk_label":"unnamed-chunk-4"},{"row":59,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-33"},"document_id":"462FD7FF","chunk_id":"cfq06oe8jrdlh","chunk_label":"unnamed-chunk-5"},{"row":64,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-25"},"document_id":"462FD7FF","chunk_id":"c9kilm1aj7mw3","chunk_label":"unnamed-chunk-6"},{"row":70,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-26"},"document_id":"462FD7FF","chunk_id":"cubqz02zklowi","chunk_label":"unnamed-chunk-7"},{"row":78,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-34"},"document_id":"462FD7FF","chunk_id":"c3w38ulaltibg","chunk_label":"unnamed-chunk-8"}],"doc_write_time":1637273652,"working_dir":null,"default_chunk_options":{"echo":true},"chunk_rendered_width":700} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000002.csv deleted file mode 100644 index a14cec9..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000002.csv +++ /dev/null @@ -1,6 +0,0 @@ -"0","" -"0","plots.Gibbs(model)" -"2","restarting interrupted promise evaluation" -"2","internal error -3 in R_decompress1" -"2","Error: lazy-load database 'C:/Users/nealf/Documents/R/win-library/4.0/IBGS/R/IBGS.rdb' is corrupt -" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000003.error b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000003.error deleted file mode 100644 index b44b123..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3w38ulaltibg/000003.error +++ /dev/null @@ -1 +0,0 @@ -{"frames":[],"message":"Error: lazy-load database 'C:/Users/nealf/Documents/R/win-library/4.0/IBGS/R/IBGS.rdb' is corrupt\n"} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3y5icinxq7eg/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3y5icinxq7eg/000002.csv deleted file mode 100644 index 0fdc1ca..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c3y5icinxq7eg/000002.csv +++ /dev/null @@ -1,9 +0,0 @@ -"0","model$v.select" -"1","[1]" -"1"," ""potential_vorticity_at_600_hPa"" " -"1"," -" -"1","[2]" -"1"," ""vertical_wind_shear_between_300_hPa_and_700_hPa""" -"1"," -" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv deleted file mode 100644 index 6eee423..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv +++ /dev/null @@ -1,8 +0,0 @@ -"0","cat(""BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20," -"0"," tau = 0.9, len = 200, k = 1, gamma = 0.5," -"0"," info = c(\""AIC\"", \""BIC\"", \""AICc\"", \""exBIC\"")," -"0"," family = c(\""gaussian\"",\""poisson\"", \""binomial\""))"")" -"1","BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, - tau = 0.9, len = 200, k = 1, gamma = 0.5, - info = c(""AIC"", ""BIC"", ""AICc"", ""exBIC""), - family = c(""gaussian"",""poisson"", ""binomial""))" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv deleted file mode 100644 index 79c0d95..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv +++ /dev/null @@ -1,6 +0,0 @@ -"0","dim(x)" -"1","[1]" -"1"," 1856" -"1"," 149" -"1"," -" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv deleted file mode 100644 index 7f46bad..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv +++ /dev/null @@ -1 +0,0 @@ -"0","plots.Gibbs(model)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata deleted file mode 100644 index 1e35f3c..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata +++ /dev/null @@ -1 +0,0 @@ -{"height":432.6328800988875,"width":700.0,"size_behavior":0,"conditions":[]} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png deleted file mode 100644 index 62ea67c9ab6f91adcc8ac89462641d24caed68e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1701 zcmd5-`!|$n9Dl81@G?WmB;<9=Nnxy(UPF0jFd}S7a+}5&xtu7sLFLF8qY-bHwc2Rw zklU(6?qwa3Tf16HG`U}@$$i%~y!+1n1^u|sInVQbKA-RRJkR(0eZJ@Wq`SE|D9WqL z0|21t$e^D904WsTuMnj1b=$|qVq7rXoIUJt2>>tvZ~zzvU=-j~;{XOYFe>8w$8xGM z6b4WcR?PvbF-(NQA`BaL55qAIFigT>_%O`w#ZQupWOzpbfYJ-elxmA8W&?nXv?JZt zgPS{(HySH4B-w}5{0YaL{4s3bWz53Q>8fUKtRA^(J@-SRi|9z{e1{?^4JtXHI%S(u zBkDXsGKoUckwIFH3djUyX^5pw2fu|J*O{24g!gS|n<_7%HoS7bxtmSxOK9rNw`*jY zjQ;SiUTcP?k^1bUiYHc$Hk+$eeQn8cP*Jg#!H&fG_5^xmSp@cQ&6YXl*WTSBI~eG< zMe5OIdk*oUN5AVG@?6VLYpO5L*2f*o;XR|COEYKl?ltcJN8+q~5F`aI@_fHz7-m4x zmMP9qO~lG?cpT>rOhnKo=T?)4_hM~cx>kITP8x}&ZOVr9WFQuomyvREG!{lc4P^OD z+xOz$@@^u8_w$tXb|&va>3NC<_> zDHeeeNjR*py*b6@mN!dV7i@FYs<57QJu+1nGN;eat!%H0RaO~y0*RPSR+4j0Q2fHd zJh06%ICbKw5G6Z+yEC81`Is&Jz%6_}$jJ$La4^W*PJuvSy83~!U@NoDEyLc5KYlCD z_>P0X_KxO@E#JB78u?)o>ovR0w6ohA?kMQU932?A-r5@e%QU%%w()d;GTj|^ss;5` zpM-+XPnGjY(ke6x6;UD<4R1E@IZI-VD2bofy}d3nMpzr^P}kh?5yKKP{saPuW!j~Z zLZyRAU`d}uTX`TLYP!T^L{5CjxD%1&F7o_Q8bOR#Q${$n`ARM{pn;Iyp=y@9b=yes zJRVbyGvuyvqB>*gi65_pJy$}^%WrN`gJcNG`6cLWW(q0A08vp=fLiVyC&pW4+7Ua7 z{;;jT`pBaz*94-`BfzG zoA2+t_+{9~GhA>7Aim%)1|df5uYqJgUd?wI%%U;IRFigijB>^f|6Ijw-5Vpme9^&C z?a^v}+UkO4wSWCs793-dNxpGGqVuQr4&@qcsrXyy7F<}2BA(sHCzQ-Hm%rRdy(nj` z1PQ&l9Q>LEJ${W*zb&IVWy1 zwQ`f3hVH`1ernDp%xl53HtoL8hsALJ1hGCmM7u+anD2d}lK}+uO&{g1B=-MQ77DdA z{T|(et$IdE_zj`(>seDiclQq zdMP)HgVKyrupazY^!HDTAiG(Gcq+p&(_fhxPy?%(R{nse*a zo6snez1ldUbu9i1WRm4LY*<%YOL#!<^}qZ@RS?MV;$D;X7=epdJR1e_@~f6zF!i<5 z$;o5wrUT7w^>k!8St{(3F;Y(o-C0V5B9H|Be&q_Yn6tz^Z%%&Qi73$C8=0d>n&{^DUvuF zM?2J6iI8et6RlQhC5<39l{n*wW5L*-ckh4jet!5qpXd7rd`z=c5B!(IOC_OE#%{*_ zvb|4#xsag4N0cpLgLi_vQpM70_1^4YUyXToGpKfU!KCp#DnGo-8AiwzfI6F;s zqiem(1DU%$ML{)DzF%Kjd4!n|l}w1mpYm+I-a{ms&=)0=-D^?@ z+ZU3>NvYYK{JBvCB_ciNOEnruZIsUWCU0K!ZuKV>v){`DkI?Oi)c`#V+Cg1N-$D-Q z+BF2MHTi~o&_T*AM*|AN6qywA-74~R*XNmz;X!aF)4)5HW-hH{iD>j#-_Jt~zY5Nb zP$JNq%1gA|+u_4PV#HW1?{#!XhF#U!fVUt13_6Er`snA_?3J1<$)lHtQ7!h8W^`U( zIHmo}Up|qEDa{oj1>10>QA{%Pl3P>CdhSJk+Tbg~JNoFOzB-bCxcqUotsH|LE)Dp& zLYlH`9FJc|37GlfeClZNFTRgbiW!xCRQ#ETfQ9NCTDoS|&VCIENesvYP;dQUk|YOc z8&f%`fd(2wPGK=GlX4lJ1>X2=zeG_`#+{L|hYS^l5@Jz2GM{r2{8lw#xic>Lhgv){ zLq86Bma5bwOB&!NW#CB_6s*k&e&Wb6sKV{%XCOYSJ_}ft zqKO`>PBm>NIz0_GF0f&_Uh_luL1PxwgQ{zcTXQ`ohjc69$Mufo%S|Sk-vLmnz2tVq zYm;=O)F8w?93baLoldxXit5}ZXj_XYO5p9?({d%gaU{(8-2UZx&zT3c>SKqKpxN#o zmw{YxZpV1W(mn#GP7}*_E0OFxkGQc(jZT_l8}UJRQ<(E|Io)Ig& z*tt6R**ImokPY-YJp?Qlyy4*(iFr^!2+X0#o&X*QLnzyE_mZ?#B;Y z1AMkl;4EI=Kbtc5&FZF+KB(#kIE6&VqWn-;u%}1H)wIZZmywVe@wvP}mHGwB%gE{X z!yET^-V@X`r`>D(_46|wGZSahP8h?^};_ z7xeEQ3oe~))^#M_4t!2HItjp#JBV9RlgxBCLO$U;yRhyCSIw4txoy!O!*X90VXceyd? z**+TQTzg%cE;JN`+F4)0D|s(H88U{s&cLFc-%#jOnpZk+&mJ6+S)r&b`n6#0u~Rmj z-;Ih;l$lLUdf^F@Ikd~;8MvNhOZ-f%!AuGHv2=SUwNxw;_T=Nhu{TJJoaCoBt3w+- z{mPX6E!Z?pS}E-MiRtbnRD9}>yIEEos{s)BujsH&gU;GTe=qKSmGaO(1slC3Q~9@K zQ_|^ujsN+-&;PTpd*Cwb`0X9c<}KpZ%1*LWfX zb1EbCB;k%rw>K4hn>u|-vRSszZMmDeP+^KFG0a|T?cI|+eY+pO#BpC?-%~_h^!txh zvT00dTRVj*HtzVTt#QUbF8Xu=L0q-W^}JADEL^S%RdK%Bd88wnTm}bBCyHAd;^J;( z6!EqYXhcG~qEHhz@0^O=SCi+DTQ`)9C66s7hX{)#`g#_BT5Jez-GRyZLxnX|>g;Ye z@_P>K!u*B6VEw@*?KKw3XzNLZlb0pHoxvixPRERZAWrAC%CuWql@Jtiu`%FxTYzpQ z?pN{xF_Z{Dvq;bi>S-@$n<c@tQq{G2820$yLi^$ z>MY5ZW>Zhztm|%uU__R^{(4%35I*3cupQxa*$NJ;hz^7W=b$G{ZVv8#rt01u_N4B> GfxiKff+>Lj diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv deleted file mode 100644 index 026696e..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv +++ /dev/null @@ -1,2 +0,0 @@ -"0","library(IBGS)" -"0","load(""tcg_ar.RData"")" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json deleted file mode 100644 index ac064a7..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json +++ /dev/null @@ -1 +0,0 @@ -{"chunk_definitions":[{"row":12,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"setup","include":false},"document_id":"462FD7FF","chunk_id":"csetup_chunk","chunk_label":"setup"},{"row":31,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-14"},"document_id":"462FD7FF","chunk_id":"cqmvnsw06ftmj","chunk_label":"unnamed-chunk-1"},{"row":36,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-10"},"document_id":"462FD7FF","chunk_id":"cs66fm6jqvos8","chunk_label":"unnamed-chunk-2"},{"row":47,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"c93jpyd1jmhhi","chunk_label":"unnamed-chunk-3"},{"row":51,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-30"},"document_id":"462FD7FF","chunk_id":"cz52i8jarnd8t","chunk_label":"unnamed-chunk-4"},{"row":59,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-1"},"document_id":"462FD7FF","chunk_id":"cfq06oe8jrdlh","chunk_label":"unnamed-chunk-5"},{"row":64,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-2"},"document_id":"462FD7FF","chunk_id":"c9kilm1aj7mw3","chunk_label":"unnamed-chunk-6"},{"row":70,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-3"},"document_id":"462FD7FF","chunk_id":"cubqz02zklowi","chunk_label":"unnamed-chunk-7"},{"row":78,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-4"},"document_id":"462FD7FF","chunk_id":"cjpy5g7olmz1k","chunk_label":"unnamed-chunk-8"},{"row":82,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-5"},"document_id":"462FD7FF","chunk_id":"c3y5icinxq7eg","chunk_label":"unnamed-chunk-9"},{"row":95,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-8"},"document_id":"462FD7FF","chunk_id":"cmory16znzyvn","chunk_label":"unnamed-chunk-10"},{"row":109,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"cs0ac6ddzb89k","chunk_label":"unnamed-chunk-12"}],"doc_write_time":1637274487,"chunk_rendered_width":700,"working_dir":null,"default_chunk_options":{"echo":true}} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000004.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000004.csv deleted file mode 100644 index 7f46bad..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000004.csv +++ /dev/null @@ -1 +0,0 @@ -"0","plots.Gibbs(model)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.metadata b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.metadata deleted file mode 100644 index 1e35f3c..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.metadata +++ /dev/null @@ -1 +0,0 @@ -{"height":432.6328800988875,"width":700.0,"size_behavior":0,"conditions":[]} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.png b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.png deleted file mode 100644 index 31b0fc9f54e18bc7651154369b8ae7b572265a4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5265 zcmc&&c{r4R*B_(>6WOLr38k`^y&-F=NtVYRni?WukahUkl3|ciQX^YRjU_e6*zQt> z7HfWFn+(P>SqEbanfIQl=Y6mDdEfWC-v6FI=K9Wk&biMy-_QA+bLN^PYs<4x0Vx3p z1Oi2#J8c7j@B$DB4{0YKD2cQ@^9Vc~tuNS_fhPolfIvJU2m}O?2Js|=58yWh#1nx? zLwI^3(x{$XwI`XKhJd7jQYxG52_duD)HDQ@%BHf}L$*Gk2z+Lf^WpjAUw9P)5gSIHHnziN&*r2$z)y;v$q~Bh2|J=}spj*Z$7xnum>NRWl&W*^?dJ`+I)@2br!yri4#*ILB(AKo9n63=UDX$R<^?KSq`U= zN=e2^Ff_$q2DMX=jw69bN*67m3RY3<%SXovM0$cjXU?D|cQ2Um`(<_dtIUb0*$qpu zq(cp#A6PKa07%CFF5t2o>xO3iE*}i7n`slr!yYf}@egBlPp^hn-G;z-#Ljt&zHUCzA);4nb%;FNE$ptvjzkS|q zJTolp$n`UTH4mDPOOotHy%%31)c2@ypnY?$Os~{pf2gueEG)W(BBm^S3my#*I?_kr z^E(bY0^Dd_-R7-=(YhXR)Ev>*)RSfg1n~Tc@f-z2oer4(2D%bZ*6{D$QIWYy`WU@O z&F+d2{PA)MHh*7GE43&`u!k!XW1{tQR@T$n;`eQs0oFH-0n^=KHW;lZ$?QUK*XW{Z7hDJ&%)DB*slAqu=RHh$j zUmX)(yWKisw(=ZoIE@JynKc&igv!~W$k z$%QpEvtEw{vZH$4}!X7E&9fn&*z%bt9-qYagrH&`*{D!_M;wUcfHY}6x z=&NDT7YnK}KjtoQOW6e_h(AhDd5=>B!PRHFA)uUE(q}`7w;R!qkQN*^ngL8dY#U|> z40mC9a-=SfuzE>b#Stn2nzn-1eN9-^Toz@;9fTIChhz?K-Ytjs>`~KncP^-gvo|U{ z9)V-kbEbt7rAZBl-3z|7l6o?cSudsPz`4Ne()|15EICxQoXQFRmMwLVJx(?r?uuw# zHjSjU12nfwiYN8CqwaD_G#n*V_=>{-Csf~nzw{Y!ws4p@@~14{Io~Y>b_#}p6m?}5 z6wYyaM>Wibz#SkRIpRIhrS!J}ird_VgOB34T#5uiq5r!7dn7P;Bj7FtM!@C!1DUJi zThwQlxpXRM4zv##;QCOQ7}R+oRnA3pt)ZvL*=mK$)^=@uHh!@oq1;eOdto;+@py_j zezn4F57Sr@@5^oBW%?j96bdVwFp?U3C_ZDR&c zyJn|i>kosacy~(r@?7F7qEXPV8Xs2Nw7PzLf7fYX7?*-&I7e9zx(M&66i z`E|10Xz5p3X9q#5k3Pf@coTbfGzy|P9OLJ4>sbya$5kT9H{dOHO>`aQO$7Q1JKA3ZUcW?M*6 znt%rK9RXFgWZ7n}@mRQFU6+**{nwbKAMpm z0nUa%0v}UPLL{&%HhtO?5Ia)oI678^HdiD7nZEg7 zqeTfH*8W-^HvXWKl3?p@iX2*;xSrSiYxSW^r=pLN8~^WpFv_}{S9wMlZaEEaf7&jv zF+W>Y7amb#^~yCQs-*S)!#5JcYBcnP#4O@ca=Cg$Ux2r7;a)OSC^hgJ<@-`y0yaiE zkG-z7RrF7t)NXp)Y!AXx)c)^RckQ-sHtB7m-fjLOY+d-1h=g#52Gc;pY^@H~r2M6jI4IIDCDT%!;;8@bH*QYVxoLJQ1#PB*vefSPD9;=h zV?bAhG-;AXcLjH^;xWX18fDcX`q_MIMQimE2CW-zwe4Caf-9ofOgZUm_`tE-4I2 z+cGL2SinoIYHMx#M`HU-ZAI!l1+6iEx!*x_tEEbl&D`0>FMO^kWT`*S3l1Sh;JsJf zkTdJ~clzaJIt2MYM~%vtm6-2BHVX3p5Yyu?^I6oE3BtVtJ*Sktm)Nm3YGu_QY)UQ0_fIy=mzuuG>+6(VTWYDJ zdL?z~7L|X|&UOAd-(^dVOPJj45!gKS=E_=v>~786zCC~e>D-O{-HGWWE%H-PJKmi5 z?fQrLlEiBKTj_loOf$XjLlcbJ_|lj8n2FLbXYI`aS=AHYPFXp|iJw^W8VGHLU%f}) z#AG5mp8D42W9%Deg3)U|veM&Y>+1ozm4;Gg;a_I2!Rg92t%j?1LN9#(_CiUNAuI z6$uzyVD#F_>}|+gdB_Gmp5&UR!=tSMP%W94m8=?>K~9ki0sX z?y~Wqv;h5%QiS_ZwC2^w!0e}sdMt;lIX(>hc*^$&u0JU=Y%C4ve8*-^$Jjz2iB3^o z9`>XKQ^KceEFvjNE=WpbqPd2DbJ4oj7y~0s=dBeTqZ$exr9IkU*3*6wqAQa25C1%L z;efo;xx%ohbA(8%w2SK_Jc+wh?&&#d4_b%legcXHw#!@E9!y;aW=-{*-$G&M5<%36 z-=;5kJrV6A#$y-Nx8+zLG?+9D>`#cKP?oxoTk{Vrr0f&bsWLgqch5x9pr#M%ngx`M z2euWj6@=4JVm-D|X+}(jO3Ai;u0Xe9%9LGR!Dst8JIf-`emBZ>kEE`ft^2e;*=zEH z<01(&xfH;IUk%jGcF=Myq*}i}OZ>P&Z3l;igZ3uAGPr(Wi>!f%5i_8MPhNl8FIf>} zZ`t?@BhQ^CFGHRX54`^}Q&wAFx)a<1qFI%@-!zvMZBUarvxlV8{dbF13uC`aaeg&u z5wkF5vGy^+A?s~^#Y%pTp#4+#5{uUOa%gf9)+%c0jUnV31{M>6s5V9Ca&WJ2$6m;;`d#!;^O2 ziyP;_G+LqG{-hDvIa0S;(=wa>@cJ832YmRl+?99RA9{OL_QQ+aF7^DQT31W>vO(LV zhu^A3$kMS#G1EkceK%V)oq2rlz12Gl!I&!v4h~^pK>A>dD_sU-zz!v<1^8Te_A{jy z`0oanu!}W(cI($Ek=D~3#5xb$Q41Oh zdfs~B?PSz@ehy?oZ)n!iGhKVbT>i(M)V*L5N{aG#VCzTp-nrhnwOiD4ssPZax<|k zof=v3W{4E)(*evvbpm+H(l}&^G49?+?$MN@m->5+DEl%1?({) kT(2jdY7c1=b+&{f57e*aUrBz+`D+nrW_kLR$(6YO0KkecSO5S3 diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.snapshot b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cjpy5g7olmz1k/000005.snapshot deleted file mode 100644 index d72435fff61b5d210ad1903871f3a9c8686470ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1860 zcmbu9`#Tc~1IIh3i(HpnqNwJQ>!wIVFNr0W>6lEWr8kCY=(ub$ZJkKulFMjgZn+yK z47oH>D2&{haLziIYfLV?aL)6d_dht_AHL7``TY8Qp3j;1qX+(%BP-d+SQS^rt{`Hs zW544$E*YzIzSH@slodWT#||q;(xvPijx$$&rTG*#96G}VyC6s4W0Cy4r?Rq^R}Wd9 zfAq_-O)JkWpkEt6-hK4mv1@H&P^r}#y{6jO8bA+e8~(MtsyrtLt@UZ={l3`8GPC(9 zkNIgltFkKdIc1y}UO4{{0MvjCYS_V4mr0>XiEFyc;A5#yHMB#up+=M{ZgHPVLp9HP zp}V?3i?~FEf~-d*rQ??*m3~?bynvj!j$2(5I9w<~Qt#LC%f|xE)nmaA30c}V%F-8iQ&~Zi9PGm2Mb@fFOlB(oq-J)+K?n0U zN84orcSJz16Gqc$M+)YEQ~Z|u?}k<-{`FVN8A(hPf1K5mEBoBsX<4GW=er_WI! zdZ*9#sSg?FFIR*EC2)O-=!x)?z-HdS7&$8z4{HqC7(%yG>y0~@)|XnUa7S=UTUjNq zlxd=jnHeJh;a7n# zA2AdONh@Fv0XG3&xK34lpyvx=KOB^BU8-2YD2RgXJ{tvt+?6YSH%N<(Q;Zw$aU*<9 zJFlb0k+Y+!sSQ1(w?RRA{T`T7Ta>p}#jSIY4 zcQbmCYkga|+p!ds-0)x>r6?F`eS4DZ@k~X2!wlFU`KUG7`r7KT zjUzzbwN?4xSILKgw$T`ppN13H(ib0C)fxfkFAGfF%~w<~Eeyq5 zmE%1)j2&y&WY_`43+k92}5<(VJf?iBb@_K{j6+z)E$Mp9Y!QJS#BRr zAJ)6YAldo%!~C_?b7<{z_Pf@F6Qg+(QX^32Qp%-B3E5md2MoNz&=V1;g8ZZu@OI>N zlX;0fs;NBPW(_ad%vPOR9hfCtulHjXNT>!co7Q!?LU#F0VTO8Jvh^1lW7*@J2(*=^id@LtoGc||8q zn5O2I-@A0|20~++H4U2F+OUenw(LV+?_8?oNMJFtA_lMc&7EFaOJX#kw=8T>cwLb{ z6cYR-SnfS_2Z90IpsO#qd%MKRj{d33Vi-1K@0IJ6y*t0~L^$Q) z*%A^6RL9A#5gYjX%&^azT6jafTz<6m&yN;9)ECUCAV`6Wmj(VSb3})E#o(Z6!d?is zCHa(Ff?%-!Ak&i}&BR7n&Y7~F!NvgYtIegDUY zEAe5JI%tMWE{2k3=!6MvGHj*`VDZ7T#hb^c`Jw^UpBhH!KF;9HO;=$!4^VV z?C8)*+4UkD_Hr~Vm(H#$-+3I)hZ-}&Z9qefljJIxgWi$FIp?A<7f@VtGP%-)5x}?| ihlnCa(xnwaneey_|0XmZch|z|)" -"1"," " -"1"," -(Intercept)" -"1"," -8.224e+00" -"1"," 7.844e-01" -"1"," -10.484" -"1"," < 2e-16" -"1"," ***" -"1"," -`46` " -"1"," -1.469e+01" -"1"," 4.097e+00" -"1"," -3.586" -"1"," 0.000335" -"1"," ***" -"1"," -`104` " -"1"," -2.139e+07" -"1"," 2.187e+06" -"1"," -9.778" -"1"," < 2e-16" -"1"," ***" -"1"," -`120` " -"1"," -4.659e-01" -"1"," 8.330e-02" -"1"," -5.594" -"1"," 2.22e-08" -"1"," ***" -"1"," -" -"1","--- -Signif. codes: " -"1","" -"1","0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1" -"1"," -" -"1"," -(Dispersion parameter for " -"1","" -"1","binomial" -"1","" -"1"," family taken to be " -"1","" -"1","1" -"1","" -"1",") - -" -"1","" -"1"," Null deviance: 471.08 on 1492 degrees of freedom -" -"1","" -"1","Residual deviance: 262.41 on 1489 degrees of freedom -" -"1","AIC: " -"1","" -"1","270.41" -"1","" -"1"," - -" -"1","" -"1","Number of Fisher Scoring iterations: " -"1","" -"1","8" -"1","" -"1"," -" -"1"," -" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv deleted file mode 100644 index 0338f24..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv +++ /dev/null @@ -1,4 +0,0 @@ -"0","cat(""library(doParallel)\nregisterDoParallel(ncores)\n"")" -"1","library(doParallel) -registerDoParallel(ncores) -" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv deleted file mode 100644 index 3624c10..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv +++ /dev/null @@ -1 +0,0 @@ -"0","knitr::opts_chunk$set(echo = TRUE)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv deleted file mode 100644 index f1cc1ae..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv +++ /dev/null @@ -1,2 +0,0 @@ -"0","cat(""model <- BlockGibbsSampler(y_train, x_train, info = \""exBIC\"", family = \""binomial\"")"")" -"1","model <- BlockGibbsSampler(y_train, x_train, info = ""exBIC"", family = ""binomial"")" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv deleted file mode 100644 index a6e7173..0000000 --- a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv +++ /dev/null @@ -1,2 +0,0 @@ -"0","cat(""?BlockGibbsSampler"")" -"1","?BlockGibbsSampler" diff --git a/.Rproj.user/shared/notebooks/patch-chunk-names b/.Rproj.user/shared/notebooks/patch-chunk-names deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/shared/notebooks/paths b/.Rproj.user/shared/notebooks/paths deleted file mode 100644 index 5716b55..0000000 --- a/.Rproj.user/shared/notebooks/paths +++ /dev/null @@ -1,33 +0,0 @@ -H:/UbuntuRv2/Gibbs-sampler-algorithm/MA-Tingjin5/simu_case1_EBMA8_log_0.R="E0DE2249" -H:/UbuntuRv2/Gibbs-sampler-algorithm/MA-Tingjin5/simu_case2_log_AoS.R="73DAD38B" -H:/UbuntuRv2/Gibbs-sampler-algorithm/MA-Tingjin5/simu_case2_log_AoS.Rout="0201E8B0" -H:/UbuntuRv2/IBGS/IBGS/.Rbuildignore="BF9F92B4" -H:/UbuntuRv2/IBGS/IBGS/DESCRIPTION="222A8554" -H:/UbuntuRv2/IBGS/IBGS/NAMESPACE="AF297CDA" -H:/UbuntuRv2/IBGS/IBGS/R/AICc.R="8C4294B7" -H:/UbuntuRv2/IBGS/IBGS/R/acceptanceratio.R="79ABFFFE" -H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs.R="E76BE3A7" -H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs1.R="5985B01C" -H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs2.R="454B0477" -H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs3.R="08526482" -H:/UbuntuRv2/IBGS/IBGS/R/burnseq.R="F2332A64" -H:/UbuntuRv2/IBGS/IBGS/R/exBIC.R="96CF40F3" -H:/UbuntuRv2/IBGS/IBGS/R/gibbs.R="9136895D" -H:/UbuntuRv2/IBGS/IBGS/R/gibbs1.R="A2DDE229" -H:/UbuntuRv2/IBGS/IBGS/R/ichart.R="819CC746" -H:/UbuntuRv2/IBGS/IBGS/R/plotgibbs.R="AD938BE1" -H:/UbuntuRv2/IBGS/IBGS/R/predgibbs.R="A0DBA68A" -H:/UbuntuRv2/IBGS/IBGS/R/reorder.R="551987C6" -H:/UbuntuRv2/IBGS/IBGS/R/resultgibbs.R="ACB29974" -H:/UbuntuRv2/IBGS/IBGS/R/sicvalue.R="84493CF9" -H:/UbuntuRv2/IBGS/IBGS/R/sigmoid.R="19F062F5" -H:/UbuntuRv2/IBGS/IBGS/R/weight.R="422749E5" -H:/UbuntuRv2/IBGS/IBGS/man/AICc.Rd="D116DE73" -H:/UbuntuRv2/IBGS/IBGS/man/ac.ratio.Rd="7A1935D0" -H:/UbuntuRv2/IBGS/IBGS/man/exBIC.Rd="1F3ED0BF" -H:/UbuntuRv2/IBGS/test.R="56BC3B27" -H:/UbuntuRv2/IBGS/test.Rout="56702734" -H:/UbuntuRv2/IBGS/test1.R="0F9CB965" -H:/UbuntuRv2/IBGS/test1.Rout="251F66DE" -H:/UbuntuRv2/TCGS/IBGS.Rmd="8107308D" -H:/UbuntuRv2/TCGS/tcg_ar.R="DBEF9E09" diff --git a/DESCRIPTION b/DESCRIPTION index 5141e59..3c2af7d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: IBGS Type: Package Title: Variable selection in ultrahigh dimensions using Gibbs sampler -Version: 0.1.2 +Version: 0.1.3 Author: Lizhong Chen Maintainer: Lizhong Chen Description: This package provides the iterated block Gibbs sampler, called IBGS, to solve the variable selection problem in ultrahigh dimensions. diff --git a/NAMESPACE b/NAMESPACE index 00a48f1..9abc78d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,6 @@ # Generated by roxygen2: do not edit by hand +importFrom("graphics", "lines", "mtext") +importFrom("stats", "AIC", "BIC", "glm", "runif", "sd") export(AICc) export(BlockGibbsSampler) @@ -10,7 +12,9 @@ export(GibbsSamplerStep) export(ac.ratio) export(burn.seq) export(exBIC) -export(plots.Gibbs) +export(plots.ichart) +export(plots.mf) +export(plots.vr) export(predicts.Gibbs) export(r.index) export(result.GibbsSampler) diff --git a/R/ichart.R b/R/ichart.R index 84774f2..2256e96 100644 --- a/R/ichart.R +++ b/R/ichart.R @@ -1,4 +1,10 @@ -ichart.Gibbs <- function(result){ +#' I-chart for the generated sequence +#' +#' @param result a list of results +#' +#' @export +#' +plots.ichart <- function(result){ v <- result$m.sic n <- length(v) n.half <- n/2 diff --git a/R/modelfreq.R b/R/modelfreq.R new file mode 100644 index 0000000..e311f5b --- /dev/null +++ b/R/modelfreq.R @@ -0,0 +1,10 @@ +#' Model frequency figure for model selection +#' +#' @param result a list of summary results +#' +#' @export +#' +plots.mf <- function(result){ + m.table <- table(round(result$m.sic,2))/length(result$m.sic) + plot(m.table, xlab = paste(result$info, "values"), ylab = "Model frequency") +} diff --git a/.Rproj.user/3992D3D4/sources/s-54CE4874/088D3205-contents b/R/variableranking.R similarity index 92% rename from .Rproj.user/3992D3D4/sources/s-54CE4874/088D3205-contents rename to R/variableranking.R index 16efbda..88aa8a6 100644 --- a/.Rproj.user/3992D3D4/sources/s-54CE4874/088D3205-contents +++ b/R/variableranking.R @@ -5,7 +5,7 @@ #' @export -plots.Gibbs <- function(result, n.vars = 20){ +plots.vr <- function(result, n.vars = 20){ colors <- rep(0,n.vars) v.order <- order(result$v.prob, decreasing = TRUE) v.freq <- result$v.prob[v.order[1:n.vars]] diff --git a/man/plots.ichart.Rd b/man/plots.ichart.Rd new file mode 100644 index 0000000..e4707ce --- /dev/null +++ b/man/plots.ichart.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ichart.R +\name{plots.ichart} +\alias{plots.ichart} +\title{I-chart for the generated sequence} +\usage{ +plots.ichart(result) +} +\arguments{ +\item{result}{a list of results} +} +\description{ +I-chart for the generated sequence +} diff --git a/man/plots.mf.Rd b/man/plots.mf.Rd new file mode 100644 index 0000000..07ef96b --- /dev/null +++ b/man/plots.mf.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/modelfreq.R +\name{plots.mf} +\alias{plots.mf} +\title{Model frequency figure for model selection} +\usage{ +plots.mf(result) +} +\arguments{ +\item{result}{a list of summary results} +} +\description{ +Model frequency figure for model selection +} diff --git a/man/plots.vr.Rd b/man/plots.vr.Rd new file mode 100644 index 0000000..d6af03c --- /dev/null +++ b/man/plots.vr.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/variableranking.R +\name{plots.vr} +\alias{plots.vr} +\title{plot the marginal probability for top predictors} +\usage{ +plots.vr(result, n.vars = 20) +} +\arguments{ +\item{result}{the result from IBGS} + +\item{n.vars}{the number of top predictors} +} +\description{ +plot the marginal probability for top predictors +}