0s autopkgtest [19:12:29]: starting date and time: 2024-03-16 19:12:29+0000 0s autopkgtest [19:12:29]: git checkout: b506e79c ssh-setup/nova: fix ARCH having two lines of data 0s autopkgtest [19:12:29]: host juju-7f2275-prod-proposed-migration-environment-3; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.f05c7rin/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --setup-commands /home/ubuntu/autopkgtest/setup-commands/setup-testbed --apt-pocket=proposed=src:r-base,src:curl,src:glib2.0,src:libpng1.6,src:libpsl,src:libtirpc,src:libxt,src:openssl,src:orthanc-python,src:readline,src:wp2latex --apt-upgrade r-cran-mcmc --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=r-base/4.3.3-2build1 curl/8.5.0-2ubuntu7 glib2.0/2.79.3-3ubuntu5 libpng1.6/1.6.43-3 libpsl/0.21.2-1.1 libtirpc/1.3.4+ds-1.1 libxt/1:1.2.1-1.2 openssl/3.0.13-0ubuntu1 orthanc-python/4.1+ds-2build3 readline/8.2-3.1 wp2latex/4.4~ds-1build1' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-3@bos03-arm64-11.secgroup --name adt-noble-arm64-r-cran-mcmc-20240316-191229-juju-7f2275-prod-proposed-migration-environment-3 --image adt/ubuntu-noble-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-3 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 65s autopkgtest [19:13:34]: testbed dpkg architecture: arm64 65s autopkgtest [19:13:34]: testbed apt version: 2.7.12 65s autopkgtest [19:13:34]: @@@@@@@@@@@@@@@@@@@@ test bed setup 65s Get:1 http://ftpmaster.internal/ubuntu noble-proposed InRelease [117 kB] 65s Get:2 http://ftpmaster.internal/ubuntu noble-proposed/universe Sources [3657 kB] 67s Get:3 http://ftpmaster.internal/ubuntu noble-proposed/multiverse Sources [51.4 kB] 67s Get:4 http://ftpmaster.internal/ubuntu noble-proposed/restricted Sources [6540 B] 67s Get:5 http://ftpmaster.internal/ubuntu noble-proposed/main Sources [474 kB] 67s Get:6 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 Packages [646 kB] 67s Get:7 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 c-n-f Metadata [3144 B] 67s Get:8 http://ftpmaster.internal/ubuntu noble-proposed/restricted arm64 Packages [33.6 kB] 67s Get:9 http://ftpmaster.internal/ubuntu noble-proposed/restricted arm64 c-n-f Metadata [116 B] 67s Get:10 http://ftpmaster.internal/ubuntu noble-proposed/universe arm64 Packages [4013 kB] 67s Get:11 http://ftpmaster.internal/ubuntu noble-proposed/universe arm64 c-n-f Metadata [8528 B] 67s Get:12 http://ftpmaster.internal/ubuntu noble-proposed/multiverse arm64 Packages [55.5 kB] 67s Get:13 http://ftpmaster.internal/ubuntu noble-proposed/multiverse arm64 c-n-f Metadata [116 B] 69s Fetched 9065 kB in 3s (3217 kB/s) 69s Reading package lists... 72s Reading package lists... 72s Building dependency tree... 72s Reading state information... 72s Calculating upgrade... 73s The following packages will be REMOVED: 73s libglib2.0-0 libssl3 73s The following NEW packages will be installed: 73s libglib2.0-0t64 libssl3t64 xdg-user-dirs 73s The following packages have been kept back: 73s curl 73s The following packages will be upgraded: 73s gir1.2-glib-2.0 libglib2.0-data libtirpc-common openssl readline-common 73s ubuntu-minimal ubuntu-standard 73s 7 upgraded, 3 newly installed, 2 to remove and 1 not upgraded. 73s Need to get 4613 kB of archives. 73s After this operation, 211 kB of additional disk space will be used. 73s Get:1 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 gir1.2-glib-2.0 arm64 2.79.3-3ubuntu5 [182 kB] 73s Get:2 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libglib2.0-0t64 arm64 2.79.3-3ubuntu5 [1527 kB] 74s Get:3 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 openssl arm64 3.0.13-0ubuntu1 [983 kB] 75s Get:4 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libssl3t64 arm64 3.0.13-0ubuntu1 [1770 kB] 75s Get:5 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libglib2.0-data all 2.79.3-3ubuntu5 [46.6 kB] 75s Get:6 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 libtirpc-common all 1.3.4+ds-1.1 [8018 B] 75s Get:7 http://ftpmaster.internal/ubuntu noble-proposed/main arm64 readline-common all 8.2-3.1 [56.4 kB] 75s Get:8 http://ftpmaster.internal/ubuntu noble/main arm64 ubuntu-minimal arm64 1.536 [10.7 kB] 75s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 xdg-user-dirs arm64 0.18-1 [18.1 kB] 75s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 ubuntu-standard arm64 1.536 [10.7 kB] 75s Fetched 4613 kB in 2s (2228 kB/s) 75s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 75s Preparing to unpack .../gir1.2-glib-2.0_2.79.3-3ubuntu5_arm64.deb ... 75s Unpacking gir1.2-glib-2.0:arm64 (2.79.3-3ubuntu5) over (2.79.2-1~ubuntu1) ... 76s dpkg: libglib2.0-0:arm64: dependency problems, but removing anyway as you requested: 76s udisks2 depends on libglib2.0-0 (>= 2.77.0). 76s shared-mime-info depends on libglib2.0-0 (>= 2.75.3). 76s python3-gi depends on libglib2.0-0 (>= 2.77.0). 76s python3-dbus depends on libglib2.0-0 (>= 2.16.0). 76s netplan.io depends on libglib2.0-0 (>= 2.70.0). 76s netplan-generator depends on libglib2.0-0 (>= 2.70.0). 76s libxmlb2:arm64 depends on libglib2.0-0 (>= 2.54.0). 76s libvolume-key1:arm64 depends on libglib2.0-0 (>= 2.18.0). 76s libudisks2-0:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libqrtr-glib0:arm64 depends on libglib2.0-0 (>= 2.56). 76s libqmi-proxy depends on libglib2.0-0 (>= 2.30.0). 76s libqmi-glib5:arm64 depends on libglib2.0-0 (>= 2.54.0). 76s libpolkit-gobject-1-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 76s libpolkit-agent-1-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 76s libnetplan0:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libmm-glib0:arm64 depends on libglib2.0-0 (>= 2.62.0). 76s libmbim-proxy depends on libglib2.0-0 (>= 2.56). 76s libmbim-glib4:arm64 depends on libglib2.0-0 (>= 2.56). 76s libjson-glib-1.0-0:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libjcat1:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libgusb2:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libgudev-1.0-0:arm64 depends on libglib2.0-0 (>= 2.38.0). 76s libgirepository-1.0-1:arm64 depends on libglib2.0-0 (>= 2.79.0). 76s libfwupd2:arm64 depends on libglib2.0-0 (>= 2.79.0). 76s libblockdev3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-utils3:arm64 depends on libglib2.0-0 (>= 2.75.3). 76s libblockdev-swap3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-part3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-nvme3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-mdraid3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-loop3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-fs3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s libblockdev-crypto3:arm64 depends on libglib2.0-0 (>= 2.42.2). 76s fwupd depends on libglib2.0-0 (>= 2.79.0). 76s bolt depends on libglib2.0-0 (>= 2.56.0). 76s 76s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 76s Removing libglib2.0-0:arm64 (2.79.2-1~ubuntu1) ... 76s Selecting previously unselected package libglib2.0-0t64:arm64. 76s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74733 files and directories currently installed.) 76s Preparing to unpack .../libglib2.0-0t64_2.79.3-3ubuntu5_arm64.deb ... 76s libglib2.0-0t64.preinst: Removing /var/lib/dpkg/info/libglib2.0-0:arm64.postrm to avoid loss of /usr/share/glib-2.0/schemas/gschemas.compiled... 76s removed '/var/lib/dpkg/info/libglib2.0-0:arm64.postrm' 76s Unpacking libglib2.0-0t64:arm64 (2.79.3-3ubuntu5) ... 76s Preparing to unpack .../openssl_3.0.13-0ubuntu1_arm64.deb ... 76s Unpacking openssl (3.0.13-0ubuntu1) over (3.0.10-1ubuntu4) ... 76s dpkg: libssl3:arm64: dependency problems, but removing anyway as you requested: 76s wget depends on libssl3 (>= 3.0.0). 76s u-boot-tools depends on libssl3 (>= 3.0.0). 76s tnftp depends on libssl3 (>= 3.0.0). 76s tcpdump depends on libssl3 (>= 3.0.0). 76s systemd-resolved depends on libssl3 (>= 3.0.0). 76s systemd depends on libssl3 (>= 3.0.0). 76s sudo depends on libssl3 (>= 3.0.0). 76s sbsigntool depends on libssl3 (>= 3.0.0). 76s rsync depends on libssl3 (>= 3.0.0). 76s python3-cryptography depends on libssl3 (>= 3.0.0). 76s openssh-server depends on libssl3 (>= 3.0.10). 76s openssh-client depends on libssl3 (>= 3.0.10). 76s mtd-utils depends on libssl3 (>= 3.0.0). 76s mokutil depends on libssl3 (>= 3.0.0). 76s linux-headers-6.8.0-11-generic depends on libssl3 (>= 3.0.0). 76s libsystemd-shared:arm64 depends on libssl3 (>= 3.0.0). 76s libssh-4:arm64 depends on libssl3 (>= 3.0.0). 76s libsasl2-modules:arm64 depends on libssl3 (>= 3.0.0). 76s libsasl2-2:arm64 depends on libssl3 (>= 3.0.0). 76s libpython3.12-minimal:arm64 depends on libssl3 (>= 3.0.0). 76s libnvme1 depends on libssl3 (>= 3.0.0). 76s libkrb5-3:arm64 depends on libssl3 (>= 3.0.0). 76s libkmod2:arm64 depends on libssl3 (>= 3.0.0). 76s libfido2-1:arm64 depends on libssl3 (>= 3.0.0). 76s libcurl4:arm64 depends on libssl3 (>= 3.0.0). 76s libcryptsetup12:arm64 depends on libssl3 (>= 3.0.0). 76s kmod depends on libssl3 (>= 3.0.0). 76s dhcpcd-base depends on libssl3 (>= 3.0.0). 76s bind9-libs:arm64 depends on libssl3 (>= 3.0.0). 76s 76s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74758 files and directories currently installed.) 76s Removing libssl3:arm64 (3.0.10-1ubuntu4) ... 76s Selecting previously unselected package libssl3t64:arm64. 76s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74747 files and directories currently installed.) 76s Preparing to unpack .../0-libssl3t64_3.0.13-0ubuntu1_arm64.deb ... 76s Unpacking libssl3t64:arm64 (3.0.13-0ubuntu1) ... 76s Preparing to unpack .../1-libglib2.0-data_2.79.3-3ubuntu5_all.deb ... 76s Unpacking libglib2.0-data (2.79.3-3ubuntu5) over (2.79.2-1~ubuntu1) ... 76s Preparing to unpack .../2-libtirpc-common_1.3.4+ds-1.1_all.deb ... 76s Unpacking libtirpc-common (1.3.4+ds-1.1) over (1.3.4+ds-1build1) ... 76s Preparing to unpack .../3-readline-common_8.2-3.1_all.deb ... 76s Unpacking readline-common (8.2-3.1) over (8.2-3) ... 76s Preparing to unpack .../4-ubuntu-minimal_1.536_arm64.deb ... 76s Unpacking ubuntu-minimal (1.536) over (1.535) ... 76s Selecting previously unselected package xdg-user-dirs. 76s Preparing to unpack .../5-xdg-user-dirs_0.18-1_arm64.deb ... 76s Unpacking xdg-user-dirs (0.18-1) ... 76s Preparing to unpack .../6-ubuntu-standard_1.536_arm64.deb ... 76s Unpacking ubuntu-standard (1.536) over (1.535) ... 76s Setting up ubuntu-minimal (1.536) ... 76s Setting up xdg-user-dirs (0.18-1) ... 76s Setting up libssl3t64:arm64 (3.0.13-0ubuntu1) ... 76s Setting up libtirpc-common (1.3.4+ds-1.1) ... 76s Setting up ubuntu-standard (1.536) ... 76s Setting up libglib2.0-0t64:arm64 (2.79.3-3ubuntu5) ... 76s No schema files found: doing nothing. 76s Setting up libglib2.0-data (2.79.3-3ubuntu5) ... 76s Setting up gir1.2-glib-2.0:arm64 (2.79.3-3ubuntu5) ... 76s Setting up openssl (3.0.13-0ubuntu1) ... 76s Setting up readline-common (8.2-3.1) ... 76s Processing triggers for man-db (2.12.0-3) ... 77s Processing triggers for install-info (7.1-3) ... 77s Processing triggers for libc-bin (2.39-0ubuntu2) ... 77s Reading package lists... 78s Building dependency tree... 78s Reading state information... 78s 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. 79s sh: Attempting to set up Debian/Ubuntu apt sources automatically 79s sh: Distribution appears to be Ubuntu 80s Reading package lists... 80s Building dependency tree... 80s Reading state information... 81s eatmydata is already the newest version (131-1). 81s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 81s Reading package lists... 81s Building dependency tree... 81s Reading state information... 81s dbus is already the newest version (1.14.10-4ubuntu1). 81s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 82s Reading package lists... 82s Building dependency tree... 82s Reading state information... 82s rng-tools-debian is already the newest version (2.4). 82s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 82s Reading package lists... 83s Building dependency tree... 83s Reading state information... 83s The following packages will be REMOVED: 83s cloud-init* python3-configobj* python3-debconf* 84s 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. 84s After this operation, 3252 kB disk space will be freed. 84s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74774 files and directories currently installed.) 84s Removing cloud-init (24.1.1-0ubuntu1) ... 85s Removing python3-configobj (5.0.8-3) ... 85s Removing python3-debconf (1.5.86) ... 85s Processing triggers for man-db (2.12.0-3) ... 85s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74385 files and directories currently installed.) 85s Purging configuration files for cloud-init (24.1.1-0ubuntu1) ... 87s dpkg: warning: while removing cloud-init, directory '/etc/cloud/cloud.cfg.d' not empty so not removed 87s Processing triggers for rsyslog (8.2312.0-3ubuntu3) ... 87s invoke-rc.d: policy-rc.d denied execution of try-restart. 87s Reading package lists... 87s Building dependency tree... 87s Reading state information... 88s linux-generic is already the newest version (6.8.0-11.11+1). 88s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 89s Hit:1 http://ftpmaster.internal/ubuntu noble InRelease 89s Hit:2 http://ftpmaster.internal/ubuntu noble-updates InRelease 89s Hit:3 http://ftpmaster.internal/ubuntu noble-security InRelease 91s Reading package lists... 91s Reading package lists... 91s Building dependency tree... 91s Reading state information... 91s Calculating upgrade... 92s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 92s Reading package lists... 92s Building dependency tree... 92s Reading state information... 93s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 93s autopkgtest [19:14:02]: rebooting testbed after setup commands that affected boot 120s autopkgtest [19:14:29]: testbed running kernel: Linux 6.8.0-11-generic #11-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 14 02:53:31 UTC 2024 123s autopkgtest [19:14:32]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-mcmc 126s Get:1 http://ftpmaster.internal/ubuntu noble/universe r-cran-mcmc 0.9-8-1 (dsc) [2083 B] 126s Get:2 http://ftpmaster.internal/ubuntu noble/universe r-cran-mcmc 0.9-8-1 (tar) [1542 kB] 126s Get:3 http://ftpmaster.internal/ubuntu noble/universe r-cran-mcmc 0.9-8-1 (diff) [3320 B] 126s gpgv: Signature made Tue Nov 21 10:57:44 2023 UTC 126s gpgv: using RSA key F1F007320A035541F0A663CA578A0494D1C646D1 126s gpgv: issuer "tille@debian.org" 126s gpgv: Can't check signature: No public key 126s dpkg-source: warning: cannot verify inline signature for ./r-cran-mcmc_0.9-8-1.dsc: no acceptable signature found 126s autopkgtest [19:14:35]: testing package r-cran-mcmc version 0.9-8-1 127s autopkgtest [19:14:36]: build not needed 128s autopkgtest [19:14:37]: test generic: preparing testbed 129s Reading package lists... 129s Building dependency tree... 129s Reading state information... 130s Starting pkgProblemResolver with broken count: 0 130s Starting 2 pkgProblemResolver with broken count: 0 130s Done 131s The following additional packages will be installed: 131s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono libblas3 131s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libgfortran5 libgomp1 131s libgraphite2-3 libharfbuzz0b libice6 libjbig0 libjpeg-turbo8 libjpeg8 131s liblapack3 liblerc4 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 131s libpaper-utils libpaper1 libpixman-1-0 libsharpyuv0 libsm6 libtcl8.6 131s libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 libxcb-shm0 131s libxft2 libxrender1 libxss1 libxt6 r-base-core r-cran-iso r-cran-mcmc 131s r-cran-xtable unzip x11-common xdg-utils zip 131s Suggested packages: 131s tcl8.6 tk8.6 elpa-ess r-doc-info | r-doc-pdf r-mathlib r-base-html 131s r-cran-knitr r-cran-plm r-cran-zoo r-cran-survival 131s Recommended packages: 131s r-recommended r-base-dev r-doc-html libfile-mimeinfo-perl libnet-dbus-perl 131s libx11-protocol-perl x11-utils x11-xserver-utils 131s The following NEW packages will be installed: 131s autopkgtest-satdep fontconfig fontconfig-config fonts-dejavu-core 131s fonts-dejavu-mono libblas3 libcairo2 libdatrie1 libdeflate0 libfontconfig1 131s libgfortran5 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 131s libjpeg-turbo8 libjpeg8 liblapack3 liblerc4 libpango-1.0-0 131s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0 131s libsharpyuv0 libsm6 libtcl8.6 libthai-data libthai0 libtiff6 libtk8.6 131s libwebp7 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6 131s r-base-core r-cran-iso r-cran-mcmc r-cran-xtable unzip x11-common xdg-utils 131s zip 131s 0 upgraded, 48 newly installed, 0 to remove and 0 not upgraded. 131s Need to get 38.7 MB/38.7 MB of archives. 131s After this operation, 78.2 MB of additional disk space will be used. 131s Get:1 /tmp/autopkgtest.SrO9t6/1-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [716 B] 131s Get:2 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-dejavu-mono all 2.37-8 [502 kB] 132s Get:3 http://ftpmaster.internal/ubuntu noble/main arm64 fonts-dejavu-core all 2.37-8 [835 kB] 132s Get:4 http://ftpmaster.internal/ubuntu noble/main arm64 fontconfig-config arm64 2.15.0-1ubuntu1 [37.0 kB] 132s Get:5 http://ftpmaster.internal/ubuntu noble/main arm64 libfontconfig1 arm64 2.15.0-1ubuntu1 [142 kB] 132s Get:6 http://ftpmaster.internal/ubuntu noble/main arm64 fontconfig arm64 2.15.0-1ubuntu1 [190 kB] 132s Get:7 http://ftpmaster.internal/ubuntu noble/main arm64 libblas3 arm64 3.12.0-3 [143 kB] 132s Get:8 http://ftpmaster.internal/ubuntu noble/main arm64 libpixman-1-0 arm64 0.42.2-1 [193 kB] 132s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 libxcb-render0 arm64 1.15-1 [16.1 kB] 132s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 libxcb-shm0 arm64 1.15-1 [5780 B] 132s Get:11 http://ftpmaster.internal/ubuntu noble/main arm64 libxrender1 arm64 1:0.9.10-1.1 [19.1 kB] 132s Get:12 http://ftpmaster.internal/ubuntu noble/main arm64 libcairo2 arm64 1.18.0-1 [550 kB] 132s Get:13 http://ftpmaster.internal/ubuntu noble/main arm64 libdatrie1 arm64 0.2.13-3 [21.7 kB] 132s Get:14 http://ftpmaster.internal/ubuntu noble/main arm64 libdeflate0 arm64 1.19-1 [43.4 kB] 132s Get:15 http://ftpmaster.internal/ubuntu noble/main arm64 libgfortran5 arm64 14-20240303-1ubuntu1 [444 kB] 132s Get:16 http://ftpmaster.internal/ubuntu noble/main arm64 libgomp1 arm64 14-20240303-1ubuntu1 [144 kB] 132s Get:17 http://ftpmaster.internal/ubuntu noble/main arm64 libgraphite2-3 arm64 1.3.14-2 [81.5 kB] 132s Get:18 http://ftpmaster.internal/ubuntu noble/main arm64 libharfbuzz0b arm64 8.3.0-2 [463 kB] 132s Get:19 http://ftpmaster.internal/ubuntu noble/main arm64 x11-common all 1:7.7+23ubuntu2 [23.4 kB] 132s Get:20 http://ftpmaster.internal/ubuntu noble/main arm64 libice6 arm64 2:1.0.10-1build2 [41.7 kB] 132s Get:21 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-turbo8 arm64 2.1.5-2ubuntu1 [160 kB] 132s Get:22 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg8 arm64 8c-2ubuntu11 [2148 B] 132s Get:23 http://ftpmaster.internal/ubuntu noble/main arm64 liblapack3 arm64 3.12.0-3 [2241 kB] 132s Get:24 http://ftpmaster.internal/ubuntu noble/main arm64 liblerc4 arm64 4.0.0+ds-4ubuntu1 [153 kB] 132s Get:25 http://ftpmaster.internal/ubuntu noble/main arm64 libthai-data all 0.1.29-2 [158 kB] 132s Get:26 http://ftpmaster.internal/ubuntu noble/main arm64 libthai0 arm64 0.1.29-2 [18.1 kB] 132s Get:27 http://ftpmaster.internal/ubuntu noble/main arm64 libpango-1.0-0 arm64 1.51.0+ds-4 [226 kB] 132s Get:28 http://ftpmaster.internal/ubuntu noble/main arm64 libpangoft2-1.0-0 arm64 1.51.0+ds-4 [41.2 kB] 132s Get:29 http://ftpmaster.internal/ubuntu noble/main arm64 libpangocairo-1.0-0 arm64 1.51.0+ds-4 [27.6 kB] 132s Get:30 http://ftpmaster.internal/ubuntu noble/main arm64 libpaper1 arm64 1.1.29 [13.1 kB] 132s Get:31 http://ftpmaster.internal/ubuntu noble/main arm64 libpaper-utils arm64 1.1.29 [8480 B] 132s Get:32 http://ftpmaster.internal/ubuntu noble/main arm64 libsharpyuv0 arm64 1.3.2-0.4 [14.4 kB] 132s Get:33 http://ftpmaster.internal/ubuntu noble/main arm64 libsm6 arm64 2:1.2.3-1build2 [16.1 kB] 132s Get:34 http://ftpmaster.internal/ubuntu noble/main arm64 libtcl8.6 arm64 8.6.13+dfsg-2 [980 kB] 132s Get:35 http://ftpmaster.internal/ubuntu noble/main arm64 libjbig0 arm64 2.1-6.1ubuntu1 [28.9 kB] 132s Get:36 http://ftpmaster.internal/ubuntu noble/main arm64 libwebp7 arm64 1.3.2-0.4 [191 kB] 132s Get:37 http://ftpmaster.internal/ubuntu noble/main arm64 libtiff6 arm64 4.5.1+git230720-3ubuntu1 [226 kB] 132s Get:38 http://ftpmaster.internal/ubuntu noble/main arm64 libxft2 arm64 2.3.6-1 [43.3 kB] 132s Get:39 http://ftpmaster.internal/ubuntu noble/main arm64 libxss1 arm64 1:1.2.3-1build2 [8252 B] 132s Get:40 http://ftpmaster.internal/ubuntu noble/main arm64 libtk8.6 arm64 8.6.13-2 [760 kB] 132s Get:41 http://ftpmaster.internal/ubuntu noble/main arm64 libxt6 arm64 1:1.2.1-1.1 [167 kB] 132s Get:42 http://ftpmaster.internal/ubuntu noble/main arm64 zip arm64 3.0-13 [172 kB] 132s Get:43 http://ftpmaster.internal/ubuntu noble/main arm64 unzip arm64 6.0-28ubuntu3 [171 kB] 132s Get:44 http://ftpmaster.internal/ubuntu noble/main arm64 xdg-utils all 1.1.3-4.1ubuntu3 [62.0 kB] 132s Get:45 http://ftpmaster.internal/ubuntu noble/universe arm64 r-base-core arm64 4.3.2-1build1 [26.8 MB] 133s Get:46 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-iso arm64 0.0-21-1 [165 kB] 133s Get:47 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-mcmc arm64 0.9-8-1 [1224 kB] 133s Get:48 http://ftpmaster.internal/ubuntu noble/universe arm64 r-cran-xtable all 1:1.8-4-2 [689 kB] 134s Preconfiguring packages ... 134s Fetched 38.7 MB in 2s (21.5 MB/s) 134s Selecting previously unselected package fonts-dejavu-mono. 134s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 74330 files and directories currently installed.) 134s Preparing to unpack .../00-fonts-dejavu-mono_2.37-8_all.deb ... 134s Unpacking fonts-dejavu-mono (2.37-8) ... 134s Selecting previously unselected package fonts-dejavu-core. 134s Preparing to unpack .../01-fonts-dejavu-core_2.37-8_all.deb ... 134s Unpacking fonts-dejavu-core (2.37-8) ... 135s Selecting previously unselected package fontconfig-config. 135s Preparing to unpack .../02-fontconfig-config_2.15.0-1ubuntu1_arm64.deb ... 135s Unpacking fontconfig-config (2.15.0-1ubuntu1) ... 135s Selecting previously unselected package libfontconfig1:arm64. 135s Preparing to unpack .../03-libfontconfig1_2.15.0-1ubuntu1_arm64.deb ... 135s Unpacking libfontconfig1:arm64 (2.15.0-1ubuntu1) ... 135s Selecting previously unselected package fontconfig. 135s Preparing to unpack .../04-fontconfig_2.15.0-1ubuntu1_arm64.deb ... 135s Unpacking fontconfig (2.15.0-1ubuntu1) ... 135s Selecting previously unselected package libblas3:arm64. 135s Preparing to unpack .../05-libblas3_3.12.0-3_arm64.deb ... 135s Unpacking libblas3:arm64 (3.12.0-3) ... 135s Selecting previously unselected package libpixman-1-0:arm64. 135s Preparing to unpack .../06-libpixman-1-0_0.42.2-1_arm64.deb ... 135s Unpacking libpixman-1-0:arm64 (0.42.2-1) ... 135s Selecting previously unselected package libxcb-render0:arm64. 135s Preparing to unpack .../07-libxcb-render0_1.15-1_arm64.deb ... 135s Unpacking libxcb-render0:arm64 (1.15-1) ... 135s Selecting previously unselected package libxcb-shm0:arm64. 135s Preparing to unpack .../08-libxcb-shm0_1.15-1_arm64.deb ... 135s Unpacking libxcb-shm0:arm64 (1.15-1) ... 135s Selecting previously unselected package libxrender1:arm64. 135s Preparing to unpack .../09-libxrender1_1%3a0.9.10-1.1_arm64.deb ... 135s Unpacking libxrender1:arm64 (1:0.9.10-1.1) ... 135s Selecting previously unselected package libcairo2:arm64. 135s Preparing to unpack .../10-libcairo2_1.18.0-1_arm64.deb ... 135s Unpacking libcairo2:arm64 (1.18.0-1) ... 135s Selecting previously unselected package libdatrie1:arm64. 135s Preparing to unpack .../11-libdatrie1_0.2.13-3_arm64.deb ... 135s Unpacking libdatrie1:arm64 (0.2.13-3) ... 135s Selecting previously unselected package libdeflate0:arm64. 135s Preparing to unpack .../12-libdeflate0_1.19-1_arm64.deb ... 135s Unpacking libdeflate0:arm64 (1.19-1) ... 135s Selecting previously unselected package libgfortran5:arm64. 135s Preparing to unpack .../13-libgfortran5_14-20240303-1ubuntu1_arm64.deb ... 135s Unpacking libgfortran5:arm64 (14-20240303-1ubuntu1) ... 135s Selecting previously unselected package libgomp1:arm64. 135s Preparing to unpack .../14-libgomp1_14-20240303-1ubuntu1_arm64.deb ... 135s Unpacking libgomp1:arm64 (14-20240303-1ubuntu1) ... 135s Selecting previously unselected package libgraphite2-3:arm64. 135s Preparing to unpack .../15-libgraphite2-3_1.3.14-2_arm64.deb ... 135s Unpacking libgraphite2-3:arm64 (1.3.14-2) ... 135s Selecting previously unselected package libharfbuzz0b:arm64. 135s Preparing to unpack .../16-libharfbuzz0b_8.3.0-2_arm64.deb ... 135s Unpacking libharfbuzz0b:arm64 (8.3.0-2) ... 136s Selecting previously unselected package x11-common. 136s Preparing to unpack .../17-x11-common_1%3a7.7+23ubuntu2_all.deb ... 136s Unpacking x11-common (1:7.7+23ubuntu2) ... 136s Selecting previously unselected package libice6:arm64. 136s Preparing to unpack .../18-libice6_2%3a1.0.10-1build2_arm64.deb ... 136s Unpacking libice6:arm64 (2:1.0.10-1build2) ... 136s Selecting previously unselected package libjpeg-turbo8:arm64. 136s Preparing to unpack .../19-libjpeg-turbo8_2.1.5-2ubuntu1_arm64.deb ... 136s Unpacking libjpeg-turbo8:arm64 (2.1.5-2ubuntu1) ... 136s Selecting previously unselected package libjpeg8:arm64. 136s Preparing to unpack .../20-libjpeg8_8c-2ubuntu11_arm64.deb ... 136s Unpacking libjpeg8:arm64 (8c-2ubuntu11) ... 136s Selecting previously unselected package liblapack3:arm64. 136s Preparing to unpack .../21-liblapack3_3.12.0-3_arm64.deb ... 136s Unpacking liblapack3:arm64 (3.12.0-3) ... 136s Selecting previously unselected package liblerc4:arm64. 136s Preparing to unpack .../22-liblerc4_4.0.0+ds-4ubuntu1_arm64.deb ... 136s Unpacking liblerc4:arm64 (4.0.0+ds-4ubuntu1) ... 136s Selecting previously unselected package libthai-data. 136s Preparing to unpack .../23-libthai-data_0.1.29-2_all.deb ... 136s Unpacking libthai-data (0.1.29-2) ... 136s Selecting previously unselected package libthai0:arm64. 136s Preparing to unpack .../24-libthai0_0.1.29-2_arm64.deb ... 136s Unpacking libthai0:arm64 (0.1.29-2) ... 136s Selecting previously unselected package libpango-1.0-0:arm64. 136s Preparing to unpack .../25-libpango-1.0-0_1.51.0+ds-4_arm64.deb ... 136s Unpacking libpango-1.0-0:arm64 (1.51.0+ds-4) ... 136s Selecting previously unselected package libpangoft2-1.0-0:arm64. 136s Preparing to unpack .../26-libpangoft2-1.0-0_1.51.0+ds-4_arm64.deb ... 136s Unpacking libpangoft2-1.0-0:arm64 (1.51.0+ds-4) ... 136s Selecting previously unselected package libpangocairo-1.0-0:arm64. 136s Preparing to unpack .../27-libpangocairo-1.0-0_1.51.0+ds-4_arm64.deb ... 136s Unpacking libpangocairo-1.0-0:arm64 (1.51.0+ds-4) ... 136s Selecting previously unselected package libpaper1:arm64. 136s Preparing to unpack .../28-libpaper1_1.1.29_arm64.deb ... 136s Unpacking libpaper1:arm64 (1.1.29) ... 136s Selecting previously unselected package libpaper-utils. 136s Preparing to unpack .../29-libpaper-utils_1.1.29_arm64.deb ... 136s Unpacking libpaper-utils (1.1.29) ... 136s Selecting previously unselected package libsharpyuv0:arm64. 136s Preparing to unpack .../30-libsharpyuv0_1.3.2-0.4_arm64.deb ... 136s Unpacking libsharpyuv0:arm64 (1.3.2-0.4) ... 136s Selecting previously unselected package libsm6:arm64. 136s Preparing to unpack .../31-libsm6_2%3a1.2.3-1build2_arm64.deb ... 136s Unpacking libsm6:arm64 (2:1.2.3-1build2) ... 136s Selecting previously unselected package libtcl8.6:arm64. 136s Preparing to unpack .../32-libtcl8.6_8.6.13+dfsg-2_arm64.deb ... 136s Unpacking libtcl8.6:arm64 (8.6.13+dfsg-2) ... 136s Selecting previously unselected package libjbig0:arm64. 136s Preparing to unpack .../33-libjbig0_2.1-6.1ubuntu1_arm64.deb ... 136s Unpacking libjbig0:arm64 (2.1-6.1ubuntu1) ... 136s Selecting previously unselected package libwebp7:arm64. 136s Preparing to unpack .../34-libwebp7_1.3.2-0.4_arm64.deb ... 136s Unpacking libwebp7:arm64 (1.3.2-0.4) ... 137s Selecting previously unselected package libtiff6:arm64. 137s Preparing to unpack .../35-libtiff6_4.5.1+git230720-3ubuntu1_arm64.deb ... 137s Unpacking libtiff6:arm64 (4.5.1+git230720-3ubuntu1) ... 137s Selecting previously unselected package libxft2:arm64. 137s Preparing to unpack .../36-libxft2_2.3.6-1_arm64.deb ... 137s Unpacking libxft2:arm64 (2.3.6-1) ... 137s Selecting previously unselected package libxss1:arm64. 137s Preparing to unpack .../37-libxss1_1%3a1.2.3-1build2_arm64.deb ... 137s Unpacking libxss1:arm64 (1:1.2.3-1build2) ... 137s Selecting previously unselected package libtk8.6:arm64. 137s Preparing to unpack .../38-libtk8.6_8.6.13-2_arm64.deb ... 137s Unpacking libtk8.6:arm64 (8.6.13-2) ... 137s Selecting previously unselected package libxt6:arm64. 137s Preparing to unpack .../39-libxt6_1%3a1.2.1-1.1_arm64.deb ... 137s Unpacking libxt6:arm64 (1:1.2.1-1.1) ... 137s Selecting previously unselected package zip. 137s Preparing to unpack .../40-zip_3.0-13_arm64.deb ... 137s Unpacking zip (3.0-13) ... 137s Selecting previously unselected package unzip. 137s Preparing to unpack .../41-unzip_6.0-28ubuntu3_arm64.deb ... 137s Unpacking unzip (6.0-28ubuntu3) ... 137s Selecting previously unselected package xdg-utils. 137s Preparing to unpack .../42-xdg-utils_1.1.3-4.1ubuntu3_all.deb ... 137s Unpacking xdg-utils (1.1.3-4.1ubuntu3) ... 137s Selecting previously unselected package r-base-core. 137s Preparing to unpack .../43-r-base-core_4.3.2-1build1_arm64.deb ... 137s Unpacking r-base-core (4.3.2-1build1) ... 137s Selecting previously unselected package r-cran-iso. 137s Preparing to unpack .../44-r-cran-iso_0.0-21-1_arm64.deb ... 137s Unpacking r-cran-iso (0.0-21-1) ... 138s Selecting previously unselected package r-cran-mcmc. 138s Preparing to unpack .../45-r-cran-mcmc_0.9-8-1_arm64.deb ... 138s Unpacking r-cran-mcmc (0.9-8-1) ... 138s Selecting previously unselected package r-cran-xtable. 138s Preparing to unpack .../46-r-cran-xtable_1%3a1.8-4-2_all.deb ... 138s Unpacking r-cran-xtable (1:1.8-4-2) ... 138s Selecting previously unselected package autopkgtest-satdep. 138s Preparing to unpack .../47-1-autopkgtest-satdep.deb ... 138s Unpacking autopkgtest-satdep (0) ... 138s Setting up libgraphite2-3:arm64 (1.3.14-2) ... 138s Setting up libpixman-1-0:arm64 (0.42.2-1) ... 138s Setting up libsharpyuv0:arm64 (1.3.2-0.4) ... 138s Setting up libpaper1:arm64 (1.1.29) ... 138s 138s Creating config file /etc/papersize with new version 138s Setting up liblerc4:arm64 (4.0.0+ds-4ubuntu1) ... 138s Setting up libxrender1:arm64 (1:0.9.10-1.1) ... 138s Setting up libdatrie1:arm64 (0.2.13-3) ... 138s Setting up libxcb-render0:arm64 (1.15-1) ... 138s Setting up unzip (6.0-28ubuntu3) ... 138s Setting up x11-common (1:7.7+23ubuntu2) ... 139s Setting up libdeflate0:arm64 (1.19-1) ... 139s Setting up libxcb-shm0:arm64 (1.15-1) ... 139s Setting up libpaper-utils (1.1.29) ... 139s Setting up libgomp1:arm64 (14-20240303-1ubuntu1) ... 139s Setting up libjbig0:arm64 (2.1-6.1ubuntu1) ... 139s Setting up zip (3.0-13) ... 139s Setting up libblas3:arm64 (3.12.0-3) ... 139s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 139s Setting up fonts-dejavu-mono (2.37-8) ... 139s Setting up libtcl8.6:arm64 (8.6.13+dfsg-2) ... 139s Setting up fonts-dejavu-core (2.37-8) ... 139s Setting up libjpeg-turbo8:arm64 (2.1.5-2ubuntu1) ... 139s Setting up libgfortran5:arm64 (14-20240303-1ubuntu1) ... 139s Setting up libwebp7:arm64 (1.3.2-0.4) ... 139s Setting up libharfbuzz0b:arm64 (8.3.0-2) ... 139s Setting up libthai-data (0.1.29-2) ... 139s Setting up libxss1:arm64 (1:1.2.3-1build2) ... 139s Setting up xdg-utils (1.1.3-4.1ubuntu3) ... 139s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 139s Setting up libjpeg8:arm64 (8c-2ubuntu11) ... 139s Setting up libice6:arm64 (2:1.0.10-1build2) ... 139s Setting up liblapack3:arm64 (3.12.0-3) ... 139s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 139s Setting up fontconfig-config (2.15.0-1ubuntu1) ... 139s Setting up libthai0:arm64 (0.1.29-2) ... 139s Setting up libtiff6:arm64 (4.5.1+git230720-3ubuntu1) ... 139s Setting up libfontconfig1:arm64 (2.15.0-1ubuntu1) ... 139s Setting up libsm6:arm64 (2:1.2.3-1build2) ... 139s Setting up fontconfig (2.15.0-1ubuntu1) ... 141s Regenerating fonts cache... done. 141s Setting up libxft2:arm64 (2.3.6-1) ... 141s Setting up libtk8.6:arm64 (8.6.13-2) ... 141s Setting up libpango-1.0-0:arm64 (1.51.0+ds-4) ... 141s Setting up libcairo2:arm64 (1.18.0-1) ... 141s Setting up libxt6:arm64 (1:1.2.1-1.1) ... 141s Setting up libpangoft2-1.0-0:arm64 (1.51.0+ds-4) ... 141s Setting up libpangocairo-1.0-0:arm64 (1.51.0+ds-4) ... 141s Setting up r-base-core (4.3.2-1build1) ... 141s 141s Creating config file /etc/R/Renviron with new version 141s Setting up r-cran-mcmc (0.9-8-1) ... 141s Setting up r-cran-iso (0.0-21-1) ... 141s Setting up r-cran-xtable (1:1.8-4-2) ... 141s Setting up autopkgtest-satdep (0) ... 141s Processing triggers for man-db (2.12.0-3) ... 142s Processing triggers for install-info (7.1-3) ... 142s Processing triggers for libc-bin (2.39-0ubuntu2) ... 147s (Reading database ... 76473 files and directories currently installed.) 147s Removing autopkgtest-satdep (0) ... 147s autopkgtest [19:14:56]: test generic: [----------------------- 147s BEGIN TEST tests/accept-batch.R 148s 148s R version 4.3.2 (2023-10-31) -- "Eye Holes" 148s Copyright (C) 2023 The R Foundation for Statistical Computing 148s Platform: aarch64-unknown-linux-gnu (64-bit) 148s 148s R is free software and comes with ABSOLUTELY NO WARRANTY. 148s You are welcome to redistribute it under certain conditions. 148s Type 'license()' or 'licence()' for distribution details. 148s 148s R is a collaborative project with many contributors. 148s Type 'contributors()' for more information and 148s 'citation()' on how to cite R or R packages in publications. 148s 148s Type 'demo()' for some demos, 'help()' for on-line help, or 148s 'help.start()' for an HTML browser interface to help. 148s Type 'q()' to quit R. 148s 148s > 148s > # new feature batching acceptance rates 148s > 148s > set.seed(42) 148s > 148s > library(mcmc) 148s > 148s > h <- function(x) if (all(x >= 0) && sum(x) <= 1) return(1) else return(-Inf) 148s > out <- metrop(h, rep(0, 5), nbatch = 100, blen = 100, scale = 0.1, 148s + debug = TRUE) 148s > 148s > all.equal(out$accept, mean(out$accept.batch)) 148s [1] TRUE 148s > 148s > foo <- matrix(out$debug.accept, nrow = out$blen) 148s > bar <- colMeans(foo) 148s > all.equal(out$accept.batch, bar) 148s [1] TRUE 148s > 148s > options(digits = 4) # try to keep insanity of computer arithmetic under control 148s > 148s > out$accept 148s [1] 0.2257 148s > t.test(out$accept.batch)$conf.int 148s [1] 0.2124 0.2390 148s attr(,"conf.level") 148s [1] 0.95 148s > 148s > 148s BEGIN TEST tests/circle.R 148s 148s R version 4.3.2 (2023-10-31) -- "Eye Holes" 148s Copyright (C) 2023 The R Foundation for Statistical Computing 148s Platform: aarch64-unknown-linux-gnu (64-bit) 148s 148s R is free software and comes with ABSOLUTELY NO WARRANTY. 148s You are welcome to redistribute it under certain conditions. 148s Type 'license()' or 'licence()' for distribution details. 148s 148s R is a collaborative project with many contributors. 148s Type 'contributors()' for more information and 148s 'citation()' on how to cite R or R packages in publications. 148s 148s Type 'demo()' for some demos, 'help()' for on-line help, or 148s 'help.start()' for an HTML browser interface to help. 148s Type 'q()' to quit R. 148s 148s > 148s > epsilon <- 1e-15 148s > 148s > library(mcmc) 148s > 148s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 148s > set.seed(42) 148s > 148s > d <- 5 148s > 148s > logh <- function(x) { 148s + if (! is.numeric(x)) stop("x not numeric") 148s + if (length(x) != d) stop("length(x) != d") 148s + fred <- 1 - sum(x^2) 148s + if (fred > 0) return(log(fred)) else return(-Inf) 148s + } 148s > 148s > out.metro <- metrop(logh, rep(0, d), 1e3, scale = 0.01) 148s > out.metro$accept 148s [1] 0.979 148s > 148s > out.metro <- metrop(out.metro, scale = 0.1) 148s > out.metro$accept 148s [1] 0.72 148s > 148s > out.metro <- metrop(out.metro, scale = 0.5) 148s > out.metro$accept 148s [1] 0.16 148s > 148s > out.metro <- metrop(out.metro, scale = 0.4) 148s > out.metro$accept 148s [1] 0.228 148s > 148s > out.metro <- metrop(out.metro, nbatch = 1e2, debug = TRUE) 148s > 148s > all(out.metro$batch[- out.metro$nbatch, ] == out.metro$current[- 1, ]) 148s [1] TRUE 148s > all(out.metro$current[1, ] == out.metro$initial) 148s [1] TRUE 148s > all(out.metro$batch[out.metro$nbatch, ] == out.metro$final) 148s [1] TRUE 148s > 148s > .Random.seed <- out.metro$initial.seed 148s > d <- ncol(out.metro$proposal) 148s > n <- nrow(out.metro$proposal) 148s > my.proposal <- matrix(NA, n, d) 148s > my.u <- double(n) 148s > ska <- out.metro$scale 148s > for (i in 1:n) { 148s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 148s + if (is.na(out.metro$u[i])) { 148s + my.u[i] <- NA 148s + } else { 148s + my.u[i] <- runif(1) 148s + } 148s + } 148s > max(abs(out.metro$proposal - my.proposal)) < epsilon 148s [1] TRUE 148s > all(is.na(out.metro$u) == is.na(my.u)) 148s [1] TRUE 148s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 148s [1] TRUE 148s > 148s > my.curr.log.green <- apply(out.metro$current, 1, logh) 148s > my.prop.log.green <- apply(out.metro$proposal, 1, logh) 148s > all(is.na(out.metro$u) == ((my.prop.log.green == -Inf) | 148s + (my.prop.log.green > my.curr.log.green))) 148s [1] TRUE 148s > foo <- my.prop.log.green - my.curr.log.green 148s > blurfle <- foo - out.metro$log.green 148s > blurfle[foo == -Inf & out.metro$log.green == -Inf] <- 0 148s > max(blurfle) < epsilon 148s [1] TRUE 148s > 148s > my.accept <- (my.prop.log.green > -Inf) & (is.na(my.u) | my.u < exp(foo)) 148s > sum(my.accept) == round(n * out.metro$accept) 148s [1] TRUE 148s > 148s > my.path <- matrix(NA, n, d) 148s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 148s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 148s > 148s > all(my.path == out.metro$batch) 148s [1] TRUE 148s > 148s > 148s BEGIN TEST tests/initseq.R 148s 148s R version 4.3.2 (2023-10-31) -- "Eye Holes" 148s Copyright (C) 2023 The R Foundation for Statistical Computing 148s Platform: aarch64-unknown-linux-gnu (64-bit) 148s 148s R is free software and comes with ABSOLUTELY NO WARRANTY. 148s You are welcome to redistribute it under certain conditions. 148s Type 'license()' or 'licence()' for distribution details. 148s 148s R is a collaborative project with many contributors. 148s Type 'contributors()' for more information and 148s 'citation()' on how to cite R or R packages in publications. 148s 148s Type 'demo()' for some demos, 'help()' for on-line help, or 148s 'help.start()' for an HTML browser interface to help. 148s Type 'q()' to quit R. 148s 148s > 148s > library(mcmc) 148s > 148s > set.seed(42) 148s > 148s > n <- 1e5 148s > rho <- 0.99 148s > 148s > x <- arima.sim(model = list(ar = rho), n = n) 148s > gamma <- acf(x, lag.max = 1999, type = "covariance", 148s + plot = FALSE)$acf 148s > k <- seq(along = gamma) 148s > Gamma <- gamma[k %% 2 == 1] + gamma[k %% 2 == 0] 148s > k <- min(seq(along = Gamma)[Gamma < 0]) 148s > Gamma <- Gamma[1:k] 148s > Gamma[k] < 0 148s [1] TRUE 148s > Gamma[k] <- 0 148s > 148s > out <- .Call(mcmc:::C_initseq, x - mean(x)) 149s > names(out) 149s [1] "gamma0" "Gamma.pos" "Gamma.dec" "Gamma.con" "var.pos" "var.dec" 149s [7] "var.con" 149s > 149s > all.equal(gamma[1], out$gamma0) 149s [1] TRUE 149s > 149s > length(out$Gamma.pos) == length(Gamma) 149s [1] TRUE 149s > all.equal(out$Gamma.pos, Gamma) 149s [1] TRUE 149s > 149s > Gamma.dec <- cummin(Gamma) 149s > all.equal(out$Gamma.dec, Gamma.dec) 149s [1] TRUE 149s > 149s > ## IGNORE_RDIFF_BEGIN 149s > library(Iso) 149s > ## IGNORE_RDIFF_END 149s > Gamma.con <- Gamma.dec[1] + cumsum(c(0, pava(diff(Gamma.dec)))) 149s Iso 0.0-21 149s 149s An "infelicity" in the function ufit() (whereby 149s it was all too easy to conflate the location of 149s the mode with its index in the entries of the 149s "x" argument) has been corrected. To this end, 149s ufit() now has arguments "lmode" (the location 149s of the mode), and "imode" (its index). At most 149s one of these arguments should be specified. See 149s the help for ufit(). 149s > all.equal(out$Gamma.con, Gamma.con) 149s [1] TRUE 149s > 149s > all.equal(0, min(out$Gamma.pos - out$Gamma.dec)) 149s [1] TRUE 149s > max(diff(out$Gamma.dec)) < sqrt(.Machine$double.eps) 149s [1] TRUE 149s > 149s > all.equal(0, min(out$Gamma.dec - out$Gamma.con)) 149s [1] TRUE 149s > min(diff(diff(out$Gamma.con))) > (- sqrt(.Machine$double.eps)) 149s [1] TRUE 149s > 149s > all.equal(2 * sum(out$Gamma.pos) - out$gamma0, out$var.pos) 149s [1] TRUE 149s > all.equal(2 * sum(out$Gamma.dec) - out$gamma0, out$var.dec) 149s [1] TRUE 149s > all.equal(2 * sum(out$Gamma.con) - out$gamma0, out$var.con) 149s [1] TRUE 149s > 149s > rev(out$Gamma.pos)[1] == 0 149s [1] TRUE 149s > rev(out$Gamma.dec)[1] == 0 149s [1] TRUE 149s > all.equal(rev(out$Gamma.con)[1], 0) 149s [1] TRUE 149s > 149s > 149s BEGIN TEST tests/isotropic.R 149s 149s R version 4.3.2 (2023-10-31) -- "Eye Holes" 149s Copyright (C) 2023 The R Foundation for Statistical Computing 149s Platform: aarch64-unknown-linux-gnu (64-bit) 149s 149s R is free software and comes with ABSOLUTELY NO WARRANTY. 149s You are welcome to redistribute it under certain conditions. 149s Type 'license()' or 'licence()' for distribution details. 149s 149s R is a collaborative project with many contributors. 149s Type 'contributors()' for more information and 149s 'citation()' on how to cite R or R packages in publications. 149s 149s Type 'demo()' for some demos, 'help()' for on-line help, or 149s 'help.start()' for an HTML browser interface to help. 149s Type 'q()' to quit R. 149s 149s > library(mcmc) 149s > isotropic <- mcmc:::isotropic 149s > isotropic.logjacobian <- mcmc:::isotropic.logjacobian 149s > 149s > # create identity test function 149s > identity <- function(x) x 149s > d.identity <- function(x) 1 149s > 149s > # check that isotropic is length preserving for vectors of lengths 1--1000 149s > all(sapply(1:1000, function(x) length(isotropic(identity)(rep(1, x))) == x)) 149s [1] TRUE 149s > 149s > # test that isotropic(identity) is an identity function 149s > all.equal(isotropic(identity)(1:10), 1:10) 149s [1] TRUE 149s > x <- seq(0, 1, length.out=200) 149s > all.equal(isotropic(identity)(x), x) 149s [1] TRUE 149s > 149s > # make sure that isotropic.logjacobian(identity, d.identity) is a 0 function 149s > all.equal(isotropic.logjacobian(identity, d.identity)(1:10), 0) 149s [1] TRUE 149s > 149s > # make sure that 0 as an input does not cause divide-by-zero errors 149s > all.equal(isotropic(identity)(0), 0) 149s [1] TRUE 149s > all.equal(isotropic(identity)(0 * 1:4), rep(0, 4)) 149s [1] TRUE 149s > all.equal(isotropic.logjacobian(identity, d.identity)(0), 0) 149s [1] TRUE 149s > all.equal(isotropic.logjacobian(identity, d.identity)(0 * 1:4), 0) 149s [1] TRUE 149s > 149s > # try isotropic with f(x) = x^2, then we should get 149s > # istropic(f)(x) := |x| * x 149s > f <- function(x) x^2 149s > all.equal(isotropic(f)(1), 1) 149s [1] TRUE 149s > all.equal(isotropic(f)(c(1, 1)), sqrt(2) * c(1, 1)) 149s [1] TRUE 149s > all.equal(isotropic(f)(c(1, 0, 1)), sqrt(2) * c(1, 0, 1)) 149s [1] TRUE 149s > 149s > # make sure lazy-loading works properly. 149s > g <- function(x) x^2 149s > g.iso <- isotropic(g) 149s > g <- function(x) x 149s > all.equal(g.iso(2), 2*2) 149s [1] TRUE 149s > 149s BEGIN TEST tests/logit.R 149s 149s R version 4.3.2 (2023-10-31) -- "Eye Holes" 149s Copyright (C) 2023 The R Foundation for Statistical Computing 149s Platform: aarch64-unknown-linux-gnu (64-bit) 149s 149s R is free software and comes with ABSOLUTELY NO WARRANTY. 149s You are welcome to redistribute it under certain conditions. 149s Type 'license()' or 'licence()' for distribution details. 149s 149s R is a collaborative project with many contributors. 149s Type 'contributors()' for more information and 149s 'citation()' on how to cite R or R packages in publications. 149s 149s Type 'demo()' for some demos, 'help()' for on-line help, or 149s 'help.start()' for an HTML browser interface to help. 149s Type 'q()' to quit R. 149s 149s > 149s > epsilon <- 1e-15 149s > 149s > library(mcmc) 149s > 149s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 149s > set.seed(42) 149s > 149s > options(digits = 3) 149s > 149s > n <- 100 149s > rho <- 0.5 149s > beta0 <- 0.25 149s > beta1 <- 1 149s > beta2 <- 0.5 149s > 149s > x1 <- rnorm(n) 149s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 149s > eta <- beta0 + beta1 * x1 + beta2 * x2 149s > p <- 1 / (1 + exp(- eta)) 149s > y <- as.numeric(runif(n) < p) 149s > 149s > out <- glm(y ~ x1 + x2, family = binomial()) 149s > ## IGNORE_RDIFF_BEGIN 149s > summary(out) 149s 149s Call: 149s glm(formula = y ~ x1 + x2, family = binomial()) 149s 149s Coefficients: 149s Estimate Std. Error z value Pr(>|z|) 149s (Intercept) 0.0599 0.2477 0.24 0.80905 149s x1 1.3682 0.3844 3.56 0.00037 *** 149s x2 0.4760 0.3135 1.52 0.12886 149s --- 149s Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 149s 149s (Dispersion parameter for binomial family taken to be 1) 149s 149s Null deviance: 138.469 on 99 degrees of freedom 149s Residual deviance: 99.293 on 97 degrees of freedom 149s AIC: 105.3 149s 149s Number of Fisher Scoring iterations: 5 149s 149s > ## IGNORE_RDIFF_END 149s > 149s > mlogl <- function(beta) { 149s + if (length(beta) != 3) stop("length(beta) != 3") 149s + beta0 <- beta[1] 149s + beta1 <- beta[2] 149s + beta2 <- beta[3] 149s + eta <- beta0 + beta1 * x1 + beta2 * x2 149s + p <- exp(eta) / (1 + exp(eta)) 149s + return(- sum(log(p[y == 1])) - sum(log(1 - p[y == 0]))) 149s + } 149s > 149s > ## IGNORE_RDIFF_BEGIN 149s > out.nlm <- nlm(mlogl, coefficients(out), print.level = 2) 149s iteration = 0 149s Parameter: 149s [1] 0.0599 1.3682 0.4760 149s Function Value 149s [1] 49.6 149s Gradient: 149s [1] 8.24e-06 5.50e-06 6.08e-06 149s 149s Relative gradient close to zero. 149s Current iterate is probably solution. 149s 149s > ## IGNORE_RDIFF_END 149s > 149s > logl <- function(beta) { 149s + if (length(beta) != 3) stop("length(beta) != 3") 149s + beta0 <- beta[1] 149s + beta1 <- beta[2] 149s + beta2 <- beta[3] 149s + eta <- beta0 + beta1 * x1 + beta2 * x2 149s + p <- exp(eta) / (1 + exp(eta)) 149s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 149s + } 149s > 149s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 149s > out.metro$accept 149s [1] 0.982 149s > 149s > out.metro <- metrop(out.metro, scale = 0.1) 149s > out.metro$accept 149s [1] 0.795 149s > 149s > out.metro <- metrop(out.metro, scale = 0.5) 149s > out.metro$accept 149s [1] 0.264 149s > 149s > apply(out.metro$batch, 2, mean) 149s [1] 0.0608 1.4230 0.5263 149s > var(out.metro$batch) 149s [,1] [,2] [,3] 149s [1,] 0.06755 -0.0108 0.00989 149s [2,] -0.01080 0.1758 -0.06155 149s [3,] 0.00989 -0.0615 0.10483 149s > olbm(out.metro$batch, 25) 149s [,1] [,2] [,3] 149s [1,] 4.54e-04 9.47e-05 -1.92e-05 149s [2,] 9.47e-05 1.84e-03 -6.45e-04 149s [3,] -1.92e-05 -6.45e-04 9.09e-04 149s > 149s > saveseed <- .Random.seed 149s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 149s + scale = 0.5, debug = TRUE) 149s > 149s > all(out.metro$batch[- out.metro$nbatch, ] == out.metro$current[- 1, ]) 149s [1] TRUE 149s > all(out.metro$current[1, ] == out.metro$initial) 149s [1] TRUE 149s > all(out.metro$batch[out.metro$nbatch, ] == out.metro$final) 149s [1] TRUE 149s > 149s > .Random.seed <- saveseed 149s > d <- ncol(out.metro$proposal) 149s > n <- nrow(out.metro$proposal) 149s > my.proposal <- matrix(NA, n, d) 149s > my.u <- double(n) 149s > ska <- out.metro$scale 149s > for (i in 1:n) { 149s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 149s + if (is.na(out.metro$u[i])) { 149s + my.u[i] <- NA 149s + } else { 149s + my.u[i] <- runif(1) 149s + } 149s + } 149s > max(abs(out.metro$proposal - my.proposal)) < epsilon 149s [1] TRUE 149s > all(is.na(out.metro$u) == is.na(my.u)) 149s [1] TRUE 149s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 149s [1] TRUE 149s > 149s > my.curr.log.green <- apply(out.metro$current, 1, logl) 149s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 149s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 149s [1] TRUE 149s > foo <- my.prop.log.green - my.curr.log.green 149s > max(abs(foo - out.metro$log.green)) < epsilon 149s [1] TRUE 149s > 149s > my.accept <- is.na(my.u) | my.u < exp(foo) 149s > sum(my.accept) == round(n * out.metro$accept) 149s [1] TRUE 149s > 149s > my.path <- matrix(NA, n, d) 149s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 149s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 149s > 149s > all(my.path == out.metro$batch) 149s [1] TRUE 149s > 149s > 149s BEGIN TEST tests/logitbat.R 149s 149s R version 4.3.2 (2023-10-31) -- "Eye Holes" 149s Copyright (C) 2023 The R Foundation for Statistical Computing 149s Platform: aarch64-unknown-linux-gnu (64-bit) 149s 149s R is free software and comes with ABSOLUTELY NO WARRANTY. 149s You are welcome to redistribute it under certain conditions. 149s Type 'license()' or 'licence()' for distribution details. 149s 149s R is a collaborative project with many contributors. 149s Type 'contributors()' for more information and 149s 'citation()' on how to cite R or R packages in publications. 149s 149s Type 'demo()' for some demos, 'help()' for on-line help, or 149s 'help.start()' for an HTML browser interface to help. 149s Type 'q()' to quit R. 149s 149s > 149s > # test batching (blen) 149s > 149s > epsilon <- 1e-15 149s > 149s > library(mcmc) 150s > 150s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 150s > set.seed(42) 150s > 150s > n <- 100 150s > rho <- 0.5 150s > beta0 <- 0.25 150s > beta1 <- 1 150s > beta2 <- 0.5 150s > 150s > x1 <- rnorm(n) 150s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 150s > eta <- beta0 + beta1 * x1 + beta2 * x2 150s > p <- 1 / (1 + exp(- eta)) 150s > y <- as.numeric(runif(n) < p) 150s > 150s > out <- glm(y ~ x1 + x2, family = binomial()) 150s > 150s > logl <- function(beta) { 150s + if (length(beta) != 3) stop("length(beta) != 3") 150s + beta0 <- beta[1] 150s + beta1 <- beta[2] 150s + beta2 <- beta[3] 150s + eta <- beta0 + beta1 * x1 + beta2 * x2 150s + p <- exp(eta) / (1 + exp(eta)) 150s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 150s + } 150s > 150s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 150s > out.metro$accept 150s [1] 0.982 150s > 150s > out.metro <- metrop(out.metro, scale = 0.1) 150s > out.metro$accept 150s [1] 0.795 150s > 150s > out.metro <- metrop(out.metro, scale = 0.5) 150s > out.metro$accept 150s [1] 0.264 150s > 150s > apply(out.metro$batch, 2, mean) 150s [1] 0.06080257 1.42304941 0.52634149 150s > 150s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 150s + scale = 0.5, debug = TRUE, blen = 5) 150s > 150s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 150s > niter == nrow(out.metro$current) 150s [1] TRUE 150s > niter == nrow(out.metro$proposal) 150s [1] TRUE 150s > all(out.metro$current[1, ] == out.metro$initial) 150s [1] TRUE 150s > all(out.metro$current[niter, ] == out.metro$final) | 150s + all(out.metro$proposal[niter, ] == out.metro$final) 150s [1] TRUE 150s > 150s > .Random.seed <- out.metro$initial.seed 150s > d <- ncol(out.metro$proposal) 150s > n <- nrow(out.metro$proposal) 150s > my.proposal <- matrix(NA, n, d) 150s > my.u <- double(n) 150s > ska <- out.metro$scale 150s > for (i in 1:n) { 150s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 150s + if (is.na(out.metro$u[i])) { 150s + my.u[i] <- NA 150s + } else { 150s + my.u[i] <- runif(1) 150s + } 150s + } 150s > max(abs(out.metro$proposal - my.proposal)) < epsilon 150s [1] TRUE 150s > all(is.na(out.metro$u) == is.na(my.u)) 150s [1] TRUE 150s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 150s [1] TRUE 150s > 150s > my.curr.log.green <- apply(out.metro$current, 1, logl) 150s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 150s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 150s [1] TRUE 150s > foo <- my.prop.log.green - my.curr.log.green 150s > max(abs(foo - out.metro$log.green)) < epsilon 150s [1] TRUE 150s > 150s > my.accept <- is.na(my.u) | my.u < exp(foo) 150s > sum(my.accept) == round(n * out.metro$accept) 150s [1] TRUE 150s > if (my.accept[niter]) { 150s + all(out.metro$proposal[niter, ] == out.metro$final) 150s + } else { 150s + all(out.metro$current[niter, ] == out.metro$final) 150s + } 150s [1] TRUE 150s > 150s > my.current <- out.metro$current 150s > my.current[my.accept, ] <- my.proposal[my.accept, ] 150s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 150s > max(abs(out.metro$current - my.current)) < epsilon 150s [1] TRUE 150s > 150s > my.path <- matrix(NA, n, d) 150s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 150s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 150s > nspac <- out.metro$nspac 150s > 150s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 150s > 150s > foom <- array(as.vector(t(my.path)), c(d, out.metro$blen, out.metro$nbatch)) 150s > boom <- t(apply(foom, c(1, 3), mean)) 150s > 150s > all(dim(boom) == dim(out.metro$batch)) 150s [1] TRUE 150s > max(abs(boom - out.metro$batch)) < epsilon 150s [1] TRUE 150s > 150s > 150s BEGIN TEST tests/logitfun.R 150s 150s R version 4.3.2 (2023-10-31) -- "Eye Holes" 150s Copyright (C) 2023 The R Foundation for Statistical Computing 150s Platform: aarch64-unknown-linux-gnu (64-bit) 150s 150s R is free software and comes with ABSOLUTELY NO WARRANTY. 150s You are welcome to redistribute it under certain conditions. 150s Type 'license()' or 'licence()' for distribution details. 150s 150s R is a collaborative project with many contributors. 150s Type 'contributors()' for more information and 150s 'citation()' on how to cite R or R packages in publications. 150s 150s Type 'demo()' for some demos, 'help()' for on-line help, or 150s 'help.start()' for an HTML browser interface to help. 150s Type 'q()' to quit R. 150s 150s > 150s > # test outfun (function) 150s > 150s > epsilon <- 1e-15 150s > 150s > library(mcmc) 150s > 150s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 150s > set.seed(42) 150s > 150s > n <- 100 150s > rho <- 0.5 150s > beta0 <- 0.25 150s > beta1 <- 1 150s > beta2 <- 0.5 150s > 150s > x1 <- rnorm(n) 150s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 150s > eta <- beta0 + beta1 * x1 + beta2 * x2 150s > p <- 1 / (1 + exp(- eta)) 150s > y <- as.numeric(runif(n) < p) 150s > 150s > out <- glm(y ~ x1 + x2, family = binomial()) 150s > 150s > logl <- function(beta) { 150s + if (length(beta) != 3) stop("length(beta) != 3") 150s + beta0 <- beta[1] 150s + beta1 <- beta[2] 150s + beta2 <- beta[3] 150s + eta <- beta0 + beta1 * x1 + beta2 * x2 150s + p <- exp(eta) / (1 + exp(eta)) 150s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 150s + } 150s > 150s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 150s > out.metro$accept 150s [1] 0.982 150s > 150s > out.metro <- metrop(out.metro, scale = 0.1) 150s > out.metro$accept 150s [1] 0.795 150s > 150s > out.metro <- metrop(out.metro, scale = 0.5) 150s > out.metro$accept 150s [1] 0.264 150s > 150s > apply(out.metro$batch, 2, mean) 150s [1] 0.06080257 1.42304941 0.52634149 150s > 150s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 150s + scale = 0.5, debug = TRUE, outfun = function(x) c(x, x^2)) 150s > 150s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 150s > niter == nrow(out.metro$current) 150s [1] TRUE 150s > niter == nrow(out.metro$proposal) 150s [1] TRUE 150s > all(out.metro$current[1, ] == out.metro$initial) 150s [1] TRUE 150s > all(out.metro$current[niter, ] == out.metro$final) | 150s + all(out.metro$proposal[niter, ] == out.metro$final) 150s [1] TRUE 150s > 150s > .Random.seed <- out.metro$initial.seed 150s > d <- ncol(out.metro$proposal) 150s > n <- nrow(out.metro$proposal) 150s > my.proposal <- matrix(NA, n, d) 150s > my.u <- double(n) 150s > ska <- out.metro$scale 150s > for (i in 1:n) { 150s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 150s + if (is.na(out.metro$u[i])) { 150s + my.u[i] <- NA 150s + } else { 150s + my.u[i] <- runif(1) 150s + } 150s + } 150s > max(abs(out.metro$proposal - my.proposal)) < epsilon 150s [1] TRUE 150s > all(is.na(out.metro$u) == is.na(my.u)) 150s [1] TRUE 150s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 150s [1] TRUE 150s > 150s > my.curr.log.green <- apply(out.metro$current, 1, logl) 150s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 150s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 150s [1] TRUE 150s > foo <- my.prop.log.green - my.curr.log.green 150s > max(abs(foo - out.metro$log.green)) < epsilon 150s [1] TRUE 150s > 150s > my.accept <- is.na(my.u) | my.u < exp(foo) 150s > sum(my.accept) == round(n * out.metro$accept) 150s [1] TRUE 150s > if (my.accept[niter]) { 150s + all(out.metro$proposal[niter, ] == out.metro$final) 150s + } else { 150s + all(out.metro$current[niter, ] == out.metro$final) 150s + } 150s [1] TRUE 150s > 150s > my.current <- out.metro$current 150s > my.current[my.accept, ] <- my.proposal[my.accept, ] 150s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 150s > max(abs(out.metro$current - my.current)) < epsilon 150s [1] TRUE 150s > 150s > my.path <- matrix(NA, n, d) 150s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 150s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 150s > nspac <- out.metro$nspac 150s > 150s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 150s > 150s > fred <- t(apply(my.path, 1, out.metro$outfun)) 150s > k <- ncol(fred) 150s > 150s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 150s > boom <- t(apply(foom, c(1, 3), mean)) 150s > 150s > all(dim(boom) == dim(out.metro$batch)) 150s [1] TRUE 150s > max(abs(boom - out.metro$batch)) < epsilon 150s [1] TRUE 150s > 150s > goom <- cbind(my.path, my.path^2) 150s > all(dim(goom) == dim(out.metro$batch)) 150s [1] TRUE 150s > max(abs(goom - out.metro$batch)) < epsilon 150s [1] TRUE 150s > 150s BEGIN TEST tests/logitfunarg.R 150s 150s R version 4.3.2 (2023-10-31) -- "Eye Holes" 150s Copyright (C) 2023 The R Foundation for Statistical Computing 150s Platform: aarch64-unknown-linux-gnu (64-bit) 150s 150s R is free software and comes with ABSOLUTELY NO WARRANTY. 150s You are welcome to redistribute it under certain conditions. 150s Type 'license()' or 'licence()' for distribution details. 150s 150s R is a collaborative project with many contributors. 150s Type 'contributors()' for more information and 150s 'citation()' on how to cite R or R packages in publications. 150s 150s Type 'demo()' for some demos, 'help()' for on-line help, or 150s 'help.start()' for an HTML browser interface to help. 150s Type 'q()' to quit R. 150s 150s > 150s > # test outfun (function) 150s > 150s > epsilon <- 1e-15 150s > 150s > library(mcmc) 150s > 150s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 150s > set.seed(42) 150s > 150s > n <- 100 150s > rho <- 0.5 150s > beta0 <- 0.25 150s > beta1 <- 1 150s > beta2 <- 0.5 150s > 150s > x1 <- rnorm(n) 150s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 150s > eta <- beta0 + beta1 * x1 + beta2 * x2 150s > p <- 1 / (1 + exp(- eta)) 150s > y <- as.numeric(runif(n) < p) 150s > 150s > out <- glm(y ~ x1 + x2, family = binomial()) 150s > 150s > logl <- function(beta) { 150s + if (length(beta) != 3) stop("length(beta) != 3") 150s + beta0 <- beta[1] 150s + beta1 <- beta[2] 150s + beta2 <- beta[3] 150s + eta <- beta0 + beta1 * x1 + beta2 * x2 150s + p <- exp(eta) / (1 + exp(eta)) 150s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 150s + } 150s > 150s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 150s > out.metro$accept 150s [1] 0.982 150s > 150s > out.metro <- metrop(out.metro, scale = 0.1) 150s > out.metro$accept 150s [1] 0.795 150s > 150s > out.metro <- metrop(out.metro, scale = 0.5) 150s > out.metro$accept 150s [1] 0.264 150s > 150s > apply(out.metro$batch, 2, mean) 150s [1] 0.06080257 1.42304941 0.52634149 150s > 150s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 150s + scale = 0.5, debug = TRUE, outfun = function(x) c(x, x^2)) 150s > 150s > out.metro <- metrop(out.metro) 150s > out.metro$outfun 150s function (x) 150s c(x, x^2) 150s 150s > dim(out.metro$batch) 150s [1] 100 6 150s > 150s > logl <- function(beta, x1, x2, y) { 150s + if (length(beta) != 3) stop("length(beta) != 3") 150s + beta0 <- beta[1] 150s + beta1 <- beta[2] 150s + beta2 <- beta[3] 150s + eta <- beta0 + beta1 * x1 + beta2 * x2 150s + p <- exp(eta) / (1 + exp(eta)) 150s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 150s + } 150s > 150s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 150s + scale = 0.5, debug = TRUE, x1 = x1, x2 = x2, y = y) 151s > out.metro$lud 151s function (beta, x1, x2, y) 151s { 151s if (length(beta) != 3) 151s stop("length(beta) != 3") 151s beta0 <- beta[1] 151s beta1 <- beta[2] 151s beta2 <- beta[3] 151s eta <- beta0 + beta1 * x1 + beta2 * x2 151s p <- exp(eta)/(1 + exp(eta)) 151s return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 151s } 151s > out.metro <- metrop(out.metro, x1 = x1, x2 = x2, y = y) 151s > out.metro$lud 151s function (beta, x1, x2, y) 151s { 151s if (length(beta) != 3) 151s stop("length(beta) != 3") 151s beta0 <- beta[1] 151s beta1 <- beta[2] 151s beta2 <- beta[3] 151s eta <- beta0 + beta1 * x1 + beta2 * x2 151s p <- exp(eta)/(1 + exp(eta)) 151s return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 151s } 151s > 151s > 151s BEGIN TEST tests/logitidx.R 151s 151s R version 4.3.2 (2023-10-31) -- "Eye Holes" 151s Copyright (C) 2023 The R Foundation for Statistical Computing 151s Platform: aarch64-unknown-linux-gnu (64-bit) 151s 151s R is free software and comes with ABSOLUTELY NO WARRANTY. 151s You are welcome to redistribute it under certain conditions. 151s Type 'license()' or 'licence()' for distribution details. 151s 151s R is a collaborative project with many contributors. 151s Type 'contributors()' for more information and 151s 'citation()' on how to cite R or R packages in publications. 151s 151s Type 'demo()' for some demos, 'help()' for on-line help, or 151s 'help.start()' for an HTML browser interface to help. 151s Type 'q()' to quit R. 151s 151s > 151s > # test outfun (positive index vector) 151s > 151s > epsilon <- 1e-15 151s > 151s > library(mcmc) 151s > 151s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 151s > set.seed(42) 151s > 151s > n <- 100 151s > rho <- 0.5 151s > beta0 <- 0.25 151s > beta1 <- 1 151s > beta2 <- 0.5 151s > 151s > x1 <- rnorm(n) 151s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 151s > eta <- beta0 + beta1 * x1 + beta2 * x2 151s > p <- 1 / (1 + exp(- eta)) 151s > y <- as.numeric(runif(n) < p) 151s > 151s > out <- glm(y ~ x1 + x2, family = binomial()) 151s > 151s > logl <- function(beta) { 151s + if (length(beta) != 3) stop("length(beta) != 3") 151s + beta0 <- beta[1] 151s + beta1 <- beta[2] 151s + beta2 <- beta[3] 151s + eta <- beta0 + beta1 * x1 + beta2 * x2 151s + p <- exp(eta) / (1 + exp(eta)) 151s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 151s + } 151s > 151s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 151s > out.metro$accept 151s [1] 0.982 151s > 151s > out.metro <- metrop(out.metro, scale = 0.1) 151s > out.metro$accept 151s [1] 0.795 151s > 151s > out.metro <- metrop(out.metro, scale = 0.5) 151s > out.metro$accept 151s [1] 0.264 151s > 151s > apply(out.metro$batch, 2, mean) 151s [1] 0.06080257 1.42304941 0.52634149 151s > 151s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 151s + scale = 0.5, debug = TRUE, outfun = c(2, 3)) 151s > 151s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 151s > niter == nrow(out.metro$current) 151s [1] TRUE 151s > niter == nrow(out.metro$proposal) 151s [1] TRUE 151s > all(out.metro$current[1, ] == out.metro$initial) 151s [1] TRUE 151s > all(out.metro$current[niter, ] == out.metro$final) | 151s + all(out.metro$proposal[niter, ] == out.metro$final) 151s [1] TRUE 151s > 151s > .Random.seed <- out.metro$initial.seed 151s > d <- ncol(out.metro$proposal) 151s > n <- nrow(out.metro$proposal) 151s > my.proposal <- matrix(NA, n, d) 151s > my.u <- double(n) 151s > ska <- out.metro$scale 151s > for (i in 1:n) { 151s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 151s + if (is.na(out.metro$u[i])) { 151s + my.u[i] <- NA 151s + } else { 151s + my.u[i] <- runif(1) 151s + } 151s + } 151s > max(abs(out.metro$proposal - my.proposal)) < epsilon 151s [1] TRUE 151s > all(is.na(out.metro$u) == is.na(my.u)) 151s [1] TRUE 151s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 151s [1] TRUE 151s > 151s > my.curr.log.green <- apply(out.metro$current, 1, logl) 151s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 151s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 151s [1] TRUE 151s > foo <- my.prop.log.green - my.curr.log.green 151s > max(abs(foo - out.metro$log.green)) < epsilon 151s [1] TRUE 151s > 151s > my.accept <- is.na(my.u) | my.u < exp(foo) 151s > sum(my.accept) == round(n * out.metro$accept) 151s [1] TRUE 151s > if (my.accept[niter]) { 151s + all(out.metro$proposal[niter, ] == out.metro$final) 151s + } else { 151s + all(out.metro$current[niter, ] == out.metro$final) 151s + } 151s [1] TRUE 151s > 151s > my.current <- out.metro$current 151s > my.current[my.accept, ] <- my.proposal[my.accept, ] 151s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 151s > max(abs(out.metro$current - my.current)) < epsilon 151s [1] TRUE 151s > 151s > my.path <- matrix(NA, n, d) 151s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 151s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 151s > nspac <- out.metro$nspac 151s > 151s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 151s > 151s > fred <- my.path[ , out.metro$outfun] 151s > k <- ncol(fred) 151s > 151s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 151s > boom <- t(apply(foom, c(1, 3), mean)) 151s > 151s > all(dim(boom) == dim(out.metro$batch)) 151s [1] TRUE 151s > max(abs(boom - out.metro$batch)) < epsilon 151s [1] TRUE 151s > 151s > 151s BEGIN TEST tests/logitlogidx.R 151s 151s R version 4.3.2 (2023-10-31) -- "Eye Holes" 151s Copyright (C) 2023 The R Foundation for Statistical Computing 151s Platform: aarch64-unknown-linux-gnu (64-bit) 151s 151s R is free software and comes with ABSOLUTELY NO WARRANTY. 151s You are welcome to redistribute it under certain conditions. 151s Type 'license()' or 'licence()' for distribution details. 151s 151s R is a collaborative project with many contributors. 151s Type 'contributors()' for more information and 151s 'citation()' on how to cite R or R packages in publications. 151s 151s Type 'demo()' for some demos, 'help()' for on-line help, or 151s 'help.start()' for an HTML browser interface to help. 151s Type 'q()' to quit R. 151s 151s > 151s > # test outfun (logical index vector) 151s > 151s > epsilon <- 1e-15 151s > 151s > library(mcmc) 151s > 151s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 151s > set.seed(42) 151s > 151s > n <- 100 151s > rho <- 0.5 151s > beta0 <- 0.25 151s > beta1 <- 1 151s > beta2 <- 0.5 151s > 151s > x1 <- rnorm(n) 151s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 151s > eta <- beta0 + beta1 * x1 + beta2 * x2 151s > p <- 1 / (1 + exp(- eta)) 151s > y <- as.numeric(runif(n) < p) 151s > 151s > out <- glm(y ~ x1 + x2, family = binomial()) 151s > 151s > logl <- function(beta) { 151s + if (length(beta) != 3) stop("length(beta) != 3") 151s + beta0 <- beta[1] 151s + beta1 <- beta[2] 151s + beta2 <- beta[3] 151s + eta <- beta0 + beta1 * x1 + beta2 * x2 151s + p <- exp(eta) / (1 + exp(eta)) 151s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 151s + } 151s > 151s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 151s > out.metro$accept 151s [1] 0.982 151s > 151s > out.metro <- metrop(out.metro, scale = 0.1) 151s > out.metro$accept 151s [1] 0.795 151s > 151s > out.metro <- metrop(out.metro, scale = 0.5) 151s > out.metro$accept 151s [1] 0.264 151s > 151s > apply(out.metro$batch, 2, mean) 151s [1] 0.06080257 1.42304941 0.52634149 151s > 151s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 151s + scale = 0.5, debug = TRUE, outfun = seq(1:3) > 1) 151s > 151s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 151s > niter == nrow(out.metro$current) 151s [1] TRUE 151s > niter == nrow(out.metro$proposal) 151s [1] TRUE 151s > all(out.metro$current[1, ] == out.metro$initial) 151s [1] TRUE 151s > all(out.metro$current[niter, ] == out.metro$final) | 151s + all(out.metro$proposal[niter, ] == out.metro$final) 151s [1] TRUE 151s > 151s > .Random.seed <- out.metro$initial.seed 151s > d <- ncol(out.metro$proposal) 151s > n <- nrow(out.metro$proposal) 151s > my.proposal <- matrix(NA, n, d) 151s > my.u <- double(n) 151s > ska <- out.metro$scale 151s > for (i in 1:n) { 151s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 151s + if (is.na(out.metro$u[i])) { 151s + my.u[i] <- NA 151s + } else { 151s + my.u[i] <- runif(1) 151s + } 151s + } 151s > max(abs(out.metro$proposal - my.proposal)) < epsilon 151s [1] TRUE 151s > all(is.na(out.metro$u) == is.na(my.u)) 151s [1] TRUE 151s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 151s [1] TRUE 151s > 151s > my.curr.log.green <- apply(out.metro$current, 1, logl) 151s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 151s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 151s [1] TRUE 151s > foo <- my.prop.log.green - my.curr.log.green 151s > max(abs(foo - out.metro$log.green)) < epsilon 151s [1] TRUE 151s > 151s > my.accept <- is.na(my.u) | my.u < exp(foo) 151s > sum(my.accept) == round(n * out.metro$accept) 151s [1] TRUE 151s > if (my.accept[niter]) { 151s + all(out.metro$proposal[niter, ] == out.metro$final) 151s + } else { 151s + all(out.metro$current[niter, ] == out.metro$final) 151s + } 151s [1] TRUE 151s > 151s > my.current <- out.metro$current 151s > my.current[my.accept, ] <- my.proposal[my.accept, ] 151s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 151s > max(abs(out.metro$current - my.current)) < epsilon 151s [1] TRUE 151s > 151s > my.path <- matrix(NA, n, d) 151s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 151s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 151s > nspac <- out.metro$nspac 151s > 151s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 151s > 151s > fred <- my.path[ , out.metro$outfun] 151s > k <- ncol(fred) 151s > 151s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 151s > boom <- t(apply(foom, c(1, 3), mean)) 151s > 151s > all(dim(boom) == dim(out.metro$batch)) 151s [1] TRUE 151s > max(abs(boom - out.metro$batch)) < epsilon 151s [1] TRUE 151s > 151s > 151s BEGIN TEST tests/logitmat.R 151s 151s R version 4.3.2 (2023-10-31) -- "Eye Holes" 151s Copyright (C) 2023 The R Foundation for Statistical Computing 151s Platform: aarch64-unknown-linux-gnu (64-bit) 151s 151s R is free software and comes with ABSOLUTELY NO WARRANTY. 151s You are welcome to redistribute it under certain conditions. 151s Type 'license()' or 'licence()' for distribution details. 151s 151s R is a collaborative project with many contributors. 151s Type 'contributors()' for more information and 151s 'citation()' on how to cite R or R packages in publications. 151s 151s Type 'demo()' for some demos, 'help()' for on-line help, or 151s 'help.start()' for an HTML browser interface to help. 151s Type 'q()' to quit R. 151s 151s > 151s > # test matrix scaling 151s > 151s > epsilon <- 1e-15 151s > 151s > library(mcmc) 151s > 151s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 151s > set.seed(42) 151s > 151s > n <- 100 151s > rho <- 0.5 151s > beta0 <- 0.25 151s > beta1 <- 1 151s > beta2 <- 0.5 151s > 151s > x1 <- rnorm(n) 151s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 151s > eta <- beta0 + beta1 * x1 + beta2 * x2 151s > p <- 1 / (1 + exp(- eta)) 151s > y <- as.numeric(runif(n) < p) 151s > 151s > out <- glm(y ~ x1 + x2, family = binomial()) 151s > 151s > logl <- function(beta) { 151s + if (length(beta) != 3) stop("length(beta) != 3") 151s + beta0 <- beta[1] 151s + beta1 <- beta[2] 151s + beta2 <- beta[3] 151s + eta <- beta0 + beta1 * x1 + beta2 * x2 151s + p <- exp(eta) / (1 + exp(eta)) 151s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 151s + } 151s > 151s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 151s > out.metro$accept 151s [1] 0.982 151s > 151s > out.metro <- metrop(out.metro, scale = 0.1) 151s > out.metro$accept 151s [1] 0.795 151s > 151s > out.metro <- metrop(out.metro, scale = 0.5) 152s > out.metro$accept 152s [1] 0.264 152s > 152s > apply(out.metro$batch, 2, mean) 152s [1] 0.06080257 1.42304941 0.52634149 152s > fred <- var(out.metro$batch) 152s > sally <- t(chol(fred)) 152s > max(abs(fred - sally %*% t(sally))) < epsilon 152s [1] TRUE 152s > 152s > out.metro <- metrop(out.metro, scale = sally) 152s > out.metro$accept 152s [1] 0.451 152s > 152s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 152s + scale = sally, debug = TRUE) 152s > names(out.metro) 152s [1] "accept" "batch" "initial" "final" "accept.batch" 152s [6] "current" "proposal" "log.green" "u" "z" 152s [11] "debug.accept" "initial.seed" "final.seed" "time" "lud" 152s [16] "nbatch" "blen" "nspac" "scale" "debug" 152s > 152s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 152s > niter == nrow(out.metro$current) 152s [1] TRUE 152s > niter == nrow(out.metro$proposal) 152s [1] TRUE 152s > all(out.metro$current[1, ] == out.metro$initial) 152s [1] TRUE 152s > all(out.metro$current[niter, ] == out.metro$final) | 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s [1] TRUE 152s > 152s > .Random.seed <- out.metro$initial.seed 152s > d <- ncol(out.metro$proposal) 152s > n <- nrow(out.metro$proposal) 152s > my.proposal <- matrix(NA, n, d) 152s > my.u <- double(n) 152s > my.z <- matrix(NA, n, d) 152s > ska <- out.metro$scale 152s > for (i in 1:n) { 152s + zed <- rnorm(d) 152s + my.proposal[i, ] <- out.metro$current[i, ] + ska %*% zed 152s + if (is.na(out.metro$u[i])) { 152s + my.u[i] <- NA 152s + } else { 152s + my.u[i] <- runif(1) 152s + } 152s + my.z[i, ] <- zed 152s + } 152s > max(abs(out.metro$proposal - my.proposal)) < epsilon 152s [1] TRUE 152s > 152s > all(is.na(out.metro$u) == is.na(my.u)) 152s [1] TRUE 152s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 152s [1] TRUE 152s > identical(out.metro$z, my.z) 152s [1] TRUE 152s > 152s > my.curr.log.green <- apply(out.metro$current, 1, logl) 152s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 152s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 152s [1] TRUE 152s > foo <- my.prop.log.green - my.curr.log.green 152s > max(abs(foo - out.metro$log.green)) < epsilon 152s [1] TRUE 152s > 152s > my.accept <- is.na(my.u) | my.u < exp(foo) 152s > sum(my.accept) == round(n * out.metro$accept) 152s [1] TRUE 152s > if (my.accept[niter]) { 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s + } else { 152s + all(out.metro$current[niter, ] == out.metro$final) 152s + } 152s [1] TRUE 152s > identical(my.accept, out.metro$debug.accept) 152s [1] TRUE 152s > 152s > my.current <- out.metro$current 152s > my.current[my.accept, ] <- my.proposal[my.accept, ] 152s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 152s > max(abs(out.metro$current - my.current)) < epsilon 152s [1] TRUE 152s > 152s > my.path <- matrix(NA, n, d) 152s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 152s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 152s > nspac <- out.metro$nspac 152s > 152s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 152s > 152s > fred <- my.path 152s > k <- ncol(fred) 152s > 152s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 152s > boom <- t(apply(foom, c(1, 3), mean)) 152s > 152s > all(dim(boom) == dim(out.metro$batch)) 152s [1] TRUE 152s > max(abs(boom - out.metro$batch)) < epsilon 152s [1] TRUE 152s > 152s > 152s BEGIN TEST tests/logitnegidx.R 152s 152s R version 4.3.2 (2023-10-31) -- "Eye Holes" 152s Copyright (C) 2023 The R Foundation for Statistical Computing 152s Platform: aarch64-unknown-linux-gnu (64-bit) 152s 152s R is free software and comes with ABSOLUTELY NO WARRANTY. 152s You are welcome to redistribute it under certain conditions. 152s Type 'license()' or 'licence()' for distribution details. 152s 152s R is a collaborative project with many contributors. 152s Type 'contributors()' for more information and 152s 'citation()' on how to cite R or R packages in publications. 152s 152s Type 'demo()' for some demos, 'help()' for on-line help, or 152s 'help.start()' for an HTML browser interface to help. 152s Type 'q()' to quit R. 152s 152s > 152s > # test outfun (negative index vector) 152s > 152s > epsilon <- 1e-15 152s > 152s > library(mcmc) 152s > 152s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 152s > set.seed(42) 152s > 152s > n <- 100 152s > rho <- 0.5 152s > beta0 <- 0.25 152s > beta1 <- 1 152s > beta2 <- 0.5 152s > 152s > x1 <- rnorm(n) 152s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 152s > eta <- beta0 + beta1 * x1 + beta2 * x2 152s > p <- 1 / (1 + exp(- eta)) 152s > y <- as.numeric(runif(n) < p) 152s > 152s > out <- glm(y ~ x1 + x2, family = binomial()) 152s > 152s > logl <- function(beta) { 152s + if (length(beta) != 3) stop("length(beta) != 3") 152s + beta0 <- beta[1] 152s + beta1 <- beta[2] 152s + beta2 <- beta[3] 152s + eta <- beta0 + beta1 * x1 + beta2 * x2 152s + p <- exp(eta) / (1 + exp(eta)) 152s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 152s + } 152s > 152s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 152s > out.metro$accept 152s [1] 0.982 152s > 152s > out.metro <- metrop(out.metro, scale = 0.1) 152s > out.metro$accept 152s [1] 0.795 152s > 152s > out.metro <- metrop(out.metro, scale = 0.5) 152s > out.metro$accept 152s [1] 0.264 152s > 152s > apply(out.metro$batch, 2, mean) 152s [1] 0.06080257 1.42304941 0.52634149 152s > 152s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 152s + scale = 0.5, debug = TRUE, outfun = - 2) 152s > 152s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 152s > niter == nrow(out.metro$current) 152s [1] TRUE 152s > niter == nrow(out.metro$proposal) 152s [1] TRUE 152s > all(out.metro$current[1, ] == out.metro$initial) 152s [1] TRUE 152s > all(out.metro$current[niter, ] == out.metro$final) | 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s [1] TRUE 152s > 152s > .Random.seed <- out.metro$initial.seed 152s > d <- ncol(out.metro$proposal) 152s > n <- nrow(out.metro$proposal) 152s > my.proposal <- matrix(NA, n, d) 152s > my.u <- double(n) 152s > ska <- out.metro$scale 152s > for (i in 1:n) { 152s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 152s + if (is.na(out.metro$u[i])) { 152s + my.u[i] <- NA 152s + } else { 152s + my.u[i] <- runif(1) 152s + } 152s + } 152s > max(abs(out.metro$proposal - my.proposal)) < epsilon 152s [1] TRUE 152s > all(is.na(out.metro$u) == is.na(my.u)) 152s [1] TRUE 152s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 152s [1] TRUE 152s > 152s > my.curr.log.green <- apply(out.metro$current, 1, logl) 152s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 152s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 152s [1] TRUE 152s > foo <- my.prop.log.green - my.curr.log.green 152s > max(abs(foo - out.metro$log.green)) < epsilon 152s [1] TRUE 152s > 152s > my.accept <- is.na(my.u) | my.u < exp(foo) 152s > sum(my.accept) == round(n * out.metro$accept) 152s [1] TRUE 152s > if (my.accept[niter]) { 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s + } else { 152s + all(out.metro$current[niter, ] == out.metro$final) 152s + } 152s [1] TRUE 152s > 152s > my.current <- out.metro$current 152s > my.current[my.accept, ] <- my.proposal[my.accept, ] 152s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 152s > max(abs(out.metro$current - my.current)) < epsilon 152s [1] TRUE 152s > 152s > my.path <- matrix(NA, n, d) 152s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 152s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 152s > nspac <- out.metro$nspac 152s > 152s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 152s > 152s > fred <- my.path[ , out.metro$outfun] 152s > k <- ncol(fred) 152s > 152s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 152s > boom <- t(apply(foom, c(1, 3), mean)) 152s > 152s > all(dim(boom) == dim(out.metro$batch)) 152s [1] TRUE 152s > max(abs(boom - out.metro$batch)) < epsilon 152s [1] TRUE 152s > 152s > 152s BEGIN TEST tests/logitsub.R 152s 152s R version 4.3.2 (2023-10-31) -- "Eye Holes" 152s Copyright (C) 2023 The R Foundation for Statistical Computing 152s Platform: aarch64-unknown-linux-gnu (64-bit) 152s 152s R is free software and comes with ABSOLUTELY NO WARRANTY. 152s You are welcome to redistribute it under certain conditions. 152s Type 'license()' or 'licence()' for distribution details. 152s 152s R is a collaborative project with many contributors. 152s Type 'contributors()' for more information and 152s 'citation()' on how to cite R or R packages in publications. 152s 152s Type 'demo()' for some demos, 'help()' for on-line help, or 152s 'help.start()' for an HTML browser interface to help. 152s Type 'q()' to quit R. 152s 152s > 152s > # test spacing (nspac) 152s > 152s > epsilon <- 1e-15 152s > 152s > library(mcmc) 152s > 152s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 152s > set.seed(42) 152s > 152s > n <- 100 152s > rho <- 0.5 152s > beta0 <- 0.25 152s > beta1 <- 1 152s > beta2 <- 0.5 152s > 152s > x1 <- rnorm(n) 152s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 152s > eta <- beta0 + beta1 * x1 + beta2 * x2 152s > p <- 1 / (1 + exp(- eta)) 152s > y <- as.numeric(runif(n) < p) 152s > 152s > out <- glm(y ~ x1 + x2, family = binomial()) 152s > 152s > logl <- function(beta) { 152s + if (length(beta) != 3) stop("length(beta) != 3") 152s + beta0 <- beta[1] 152s + beta1 <- beta[2] 152s + beta2 <- beta[3] 152s + eta <- beta0 + beta1 * x1 + beta2 * x2 152s + p <- exp(eta) / (1 + exp(eta)) 152s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 152s + } 152s > 152s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 152s > out.metro$accept 152s [1] 0.982 152s > 152s > out.metro <- metrop(out.metro, scale = 0.1) 152s > out.metro$accept 152s [1] 0.795 152s > 152s > out.metro <- metrop(out.metro, scale = 0.5) 152s > out.metro$accept 152s [1] 0.264 152s > 152s > apply(out.metro$batch, 2, mean) 152s [1] 0.06080257 1.42304941 0.52634149 152s > 152s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 152s + scale = 0.5, debug = TRUE, nspac = 3) 152s > 152s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 152s > niter == nrow(out.metro$current) 152s [1] TRUE 152s > niter == nrow(out.metro$proposal) 152s [1] TRUE 152s > all(out.metro$current[1, ] == out.metro$initial) 152s [1] TRUE 152s > all(out.metro$current[niter, ] == out.metro$final) | 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s [1] TRUE 152s > 152s > .Random.seed <- out.metro$initial.seed 152s > d <- ncol(out.metro$proposal) 152s > n <- nrow(out.metro$proposal) 152s > my.proposal <- matrix(NA, n, d) 152s > my.u <- double(n) 152s > ska <- out.metro$scale 152s > for (i in 1:n) { 152s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 152s + if (is.na(out.metro$u[i])) { 152s + my.u[i] <- NA 152s + } else { 152s + my.u[i] <- runif(1) 152s + } 152s + } 152s > max(abs(out.metro$proposal - my.proposal)) < epsilon 152s [1] TRUE 152s > all(is.na(out.metro$u) == is.na(my.u)) 152s [1] TRUE 152s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 152s [1] TRUE 152s > 152s > my.curr.log.green <- apply(out.metro$current, 1, logl) 152s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 152s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 152s [1] TRUE 152s > foo <- my.prop.log.green - my.curr.log.green 152s > max(abs(foo - out.metro$log.green)) < epsilon 152s [1] TRUE 152s > 152s > my.accept <- is.na(my.u) | my.u < exp(foo) 152s > sum(my.accept) == round(n * out.metro$accept) 152s [1] TRUE 152s > if (my.accept[niter]) { 152s + all(out.metro$proposal[niter, ] == out.metro$final) 152s + } else { 152s + all(out.metro$current[niter, ] == out.metro$final) 152s + } 152s [1] TRUE 152s > 152s > my.current <- out.metro$current 152s > my.current[my.accept, ] <- my.proposal[my.accept, ] 152s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 152s > max(abs(out.metro$current - my.current)) < epsilon 152s [1] TRUE 152s > 152s > my.path <- matrix(NA, n, d) 152s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 152s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 152s > nspac <- out.metro$nspac 152s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 152s > all(dim(my.path) == dim(out.metro$batch)) 152s [1] TRUE 152s > 152s > all(my.path == out.metro$batch) 152s [1] TRUE 152s > 152s > 152s BEGIN TEST tests/logitsubbat.R 153s 153s R version 4.3.2 (2023-10-31) -- "Eye Holes" 153s Copyright (C) 2023 The R Foundation for Statistical Computing 153s Platform: aarch64-unknown-linux-gnu (64-bit) 153s 153s R is free software and comes with ABSOLUTELY NO WARRANTY. 153s You are welcome to redistribute it under certain conditions. 153s Type 'license()' or 'licence()' for distribution details. 153s 153s R is a collaborative project with many contributors. 153s Type 'contributors()' for more information and 153s 'citation()' on how to cite R or R packages in publications. 153s 153s Type 'demo()' for some demos, 'help()' for on-line help, or 153s 'help.start()' for an HTML browser interface to help. 153s Type 'q()' to quit R. 153s 153s > 153s > # test batching (blen) and spacing (nspac) together 153s > 153s > epsilon <- 1e-15 153s > 153s > library(mcmc) 153s > 153s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 153s > set.seed(42) 153s > 153s > n <- 100 153s > rho <- 0.5 153s > beta0 <- 0.25 153s > beta1 <- 1 153s > beta2 <- 0.5 153s > 153s > x1 <- rnorm(n) 153s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 153s > eta <- beta0 + beta1 * x1 + beta2 * x2 153s > p <- 1 / (1 + exp(- eta)) 153s > y <- as.numeric(runif(n) < p) 153s > 153s > out <- glm(y ~ x1 + x2, family = binomial()) 153s > 153s > logl <- function(beta) { 153s + if (length(beta) != 3) stop("length(beta) != 3") 153s + beta0 <- beta[1] 153s + beta1 <- beta[2] 153s + beta2 <- beta[3] 153s + eta <- beta0 + beta1 * x1 + beta2 * x2 153s + p <- exp(eta) / (1 + exp(eta)) 153s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 153s + } 153s > 153s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 153s > out.metro$accept 153s [1] 0.982 153s > 153s > out.metro <- metrop(out.metro, scale = 0.1) 153s > out.metro$accept 153s [1] 0.795 153s > 153s > out.metro <- metrop(out.metro, scale = 0.5) 153s > out.metro$accept 153s [1] 0.264 153s > 153s > apply(out.metro$batch, 2, mean) 153s [1] 0.06080257 1.42304941 0.52634149 153s > 153s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 153s + scale = 0.5, debug = TRUE, blen = 5, nspac = 3) 153s > 153s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 153s > niter == nrow(out.metro$current) 153s [1] TRUE 153s > niter == nrow(out.metro$proposal) 153s [1] TRUE 153s > all(out.metro$current[1, ] == out.metro$initial) 153s [1] TRUE 153s > all(out.metro$current[niter, ] == out.metro$final) | 153s + all(out.metro$proposal[niter, ] == out.metro$final) 153s [1] TRUE 153s > 153s > .Random.seed <- out.metro$initial.seed 153s > d <- ncol(out.metro$proposal) 153s > n <- nrow(out.metro$proposal) 153s > my.proposal <- matrix(NA, n, d) 153s > my.u <- double(n) 153s > ska <- out.metro$scale 153s > for (i in 1:n) { 153s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 153s + if (is.na(out.metro$u[i])) { 153s + my.u[i] <- NA 153s + } else { 153s + my.u[i] <- runif(1) 153s + } 153s + } 153s > max(abs(out.metro$proposal - my.proposal)) < epsilon 153s [1] TRUE 153s > all(is.na(out.metro$u) == is.na(my.u)) 153s [1] TRUE 153s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 153s [1] TRUE 153s > 153s > my.curr.log.green <- apply(out.metro$current, 1, logl) 153s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 153s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 153s [1] TRUE 153s > foo <- my.prop.log.green - my.curr.log.green 153s > max(abs(foo - out.metro$log.green)) < epsilon 153s [1] TRUE 153s > 153s > my.accept <- is.na(my.u) | my.u < exp(foo) 153s > sum(my.accept) == round(n * out.metro$accept) 153s [1] TRUE 153s > if (my.accept[niter]) { 153s + all(out.metro$proposal[niter, ] == out.metro$final) 153s + } else { 153s + all(out.metro$current[niter, ] == out.metro$final) 153s + } 153s [1] TRUE 153s > 153s > my.current <- out.metro$current 153s > my.current[my.accept, ] <- my.proposal[my.accept, ] 153s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 153s > max(abs(out.metro$current - my.current)) < epsilon 153s [1] TRUE 153s > 153s > my.path <- matrix(NA, n, d) 153s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 153s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 153s > nspac <- out.metro$nspac 153s > 153s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 153s > 153s > foom <- array(as.vector(t(my.path)), c(d, out.metro$blen, out.metro$nbatch)) 153s > boom <- t(apply(foom, c(1, 3), mean)) 153s > 153s > all(dim(boom) == dim(out.metro$batch)) 153s [1] TRUE 153s > max(abs(boom - out.metro$batch)) < epsilon 153s [1] TRUE 153s > 153s > 153s BEGIN TEST tests/logitvec.R 153s 153s R version 4.3.2 (2023-10-31) -- "Eye Holes" 153s Copyright (C) 2023 The R Foundation for Statistical Computing 153s Platform: aarch64-unknown-linux-gnu (64-bit) 153s 153s R is free software and comes with ABSOLUTELY NO WARRANTY. 153s You are welcome to redistribute it under certain conditions. 153s Type 'license()' or 'licence()' for distribution details. 153s 153s R is a collaborative project with many contributors. 153s Type 'contributors()' for more information and 153s 'citation()' on how to cite R or R packages in publications. 153s 153s Type 'demo()' for some demos, 'help()' for on-line help, or 153s 'help.start()' for an HTML browser interface to help. 153s Type 'q()' to quit R. 153s 153s > 153s > # test vector (diag(foo)) scaling 153s > 153s > epsilon <- 1e-15 153s > 153s > library(mcmc) 153s > 153s > suppressWarnings(RNGkind("Marsaglia-Multicarry")) 153s > set.seed(42) 153s > 153s > n <- 100 153s > rho <- 0.5 153s > beta0 <- 0.25 153s > beta1 <- 1 153s > beta2 <- 0.5 153s > 153s > x1 <- rnorm(n) 153s > x2 <- rho * x1 + sqrt(1 - rho^2) * rnorm(n) 153s > eta <- beta0 + beta1 * x1 + beta2 * x2 153s > p <- 1 / (1 + exp(- eta)) 153s > y <- as.numeric(runif(n) < p) 153s > 153s > out <- glm(y ~ x1 + x2, family = binomial()) 153s > 153s > logl <- function(beta) { 153s + if (length(beta) != 3) stop("length(beta) != 3") 153s + beta0 <- beta[1] 153s + beta1 <- beta[2] 153s + beta2 <- beta[3] 153s + eta <- beta0 + beta1 * x1 + beta2 * x2 153s + p <- exp(eta) / (1 + exp(eta)) 153s + return(sum(log(p[y == 1])) + sum(log(1 - p[y == 0]))) 153s + } 153s > 153s > out.metro <- metrop(logl, coefficients(out), 1e3, scale = 0.01) 153s > out.metro$accept 153s [1] 0.982 153s > 153s > out.metro <- metrop(out.metro, scale = 0.1) 153s > out.metro$accept 153s [1] 0.795 153s > 153s > out.metro <- metrop(out.metro, scale = 0.5) 153s > out.metro$accept 153s [1] 0.264 153s > 153s > apply(out.metro$batch, 2, mean) 153s [1] 0.06080257 1.42304941 0.52634149 153s > sally <- apply(out.metro$batch, 2, sd) 153s > 153s > out.metro <- metrop(out.metro, scale = sally) 153s > out.metro$accept 153s [1] 0.398 153s > 153s > out.metro <- metrop(logl, as.numeric(coefficients(out)), 1e2, 153s + scale = sally, debug = TRUE) 153s > 153s > niter <- out.metro$nbatch * out.metro$blen * out.metro$nspac 153s > niter == nrow(out.metro$current) 153s [1] TRUE 153s > niter == nrow(out.metro$proposal) 153s [1] TRUE 153s > all(out.metro$current[1, ] == out.metro$initial) 153s [1] TRUE 153s > all(out.metro$current[niter, ] == out.metro$final) | 153s + all(out.metro$proposal[niter, ] == out.metro$final) 153s [1] TRUE 153s > 153s > .Random.seed <- out.metro$initial.seed 153s > d <- ncol(out.metro$proposal) 153s > n <- nrow(out.metro$proposal) 153s > my.proposal <- matrix(NA, n, d) 153s > my.u <- double(n) 153s > ska <- out.metro$scale 153s > for (i in 1:n) { 153s + my.proposal[i, ] <- out.metro$current[i, ] + ska * rnorm(d) 153s + if (is.na(out.metro$u[i])) { 153s + my.u[i] <- NA 153s + } else { 153s + my.u[i] <- runif(1) 153s + } 153s + } 153s > max(abs(out.metro$proposal - my.proposal)) < epsilon 153s [1] TRUE 153s > 153s > all(is.na(out.metro$u) == is.na(my.u)) 153s [1] TRUE 153s > all(out.metro$u[!is.na(out.metro$u)] == my.u[!is.na(my.u)]) 153s [1] TRUE 153s > 153s > my.curr.log.green <- apply(out.metro$current, 1, logl) 153s > my.prop.log.green <- apply(out.metro$proposal, 1, logl) 153s > all(is.na(out.metro$u) == (my.prop.log.green > my.curr.log.green)) 153s [1] TRUE 153s > foo <- my.prop.log.green - my.curr.log.green 153s > max(abs(foo - out.metro$log.green)) < epsilon 153s [1] TRUE 153s > 153s > my.accept <- is.na(my.u) | my.u < exp(foo) 153s > sum(my.accept) == round(n * out.metro$accept) 153s [1] TRUE 153s > if (my.accept[niter]) { 153s + all(out.metro$proposal[niter, ] == out.metro$final) 153s + } else { 153s + all(out.metro$current[niter, ] == out.metro$final) 153s + } 153s [1] TRUE 153s > 153s > my.current <- out.metro$current 153s > my.current[my.accept, ] <- my.proposal[my.accept, ] 153s > my.current <- rbind(out.metro$initial, my.current[- niter, ]) 153s > max(abs(out.metro$current - my.current)) < epsilon 153s [1] TRUE 153s > 153s > my.path <- matrix(NA, n, d) 153s > my.path[my.accept, ] <- out.metro$proposal[my.accept, ] 153s > my.path[! my.accept, ] <- out.metro$current[! my.accept, ] 153s > nspac <- out.metro$nspac 153s > 153s > my.path <- my.path[seq(nspac, niter, by = nspac), ] 153s > 153s > fred <- my.path 153s > k <- ncol(fred) 153s > 153s > foom <- array(as.vector(t(fred)), c(k, out.metro$blen, out.metro$nbatch)) 153s > boom <- t(apply(foom, c(1, 3), mean)) 153s > 153s > all(dim(boom) == dim(out.metro$batch)) 153s [1] TRUE 153s > max(abs(boom - out.metro$batch)) < epsilon 153s [1] TRUE 153s > 153s > 153s BEGIN TEST tests/morph.R 153s 153s R version 4.3.2 (2023-10-31) -- "Eye Holes" 153s Copyright (C) 2023 The R Foundation for Statistical Computing 153s Platform: aarch64-unknown-linux-gnu (64-bit) 153s 153s R is free software and comes with ABSOLUTELY NO WARRANTY. 153s You are welcome to redistribute it under certain conditions. 153s Type 'license()' or 'licence()' for distribution details. 153s 153s R is a collaborative project with many contributors. 153s Type 'contributors()' for more information and 153s 'citation()' on how to cite R or R packages in publications. 153s 153s Type 'demo()' for some demos, 'help()' for on-line help, or 153s 'help.start()' for an HTML browser interface to help. 153s Type 'q()' to quit R. 153s 153s > library(mcmc) 153s > isotropic <- mcmc:::isotropic 153s > isotropic.logjacobian <- mcmc:::isotropic.logjacobian 153s > 153s > # make sure morph identity works properly 153s > TestMorphIdentity <- function(m.id) { 153s + ident.func <- function(x) x 153s + if (!all.equal(m.id$transform(1:10), 1:10)) 153s + return(FALSE) 153s + if (!all.equal(m.id$inverse(1:10), 1:10)) 153s + return(FALSE) 153s + x <- seq(-1,1, length.out=15) 153s + if (!all.equal(sapply(x, m.id$lud(function(x) dnorm(x, log=TRUE))), 153s + dnorm(x, log=TRUE))) 153s + return(FALSE) 153s + if (!all.equal(m.id$outfun(ident.func)(x), x)) 153s + return(FALSE) 153s + return(TRUE) 153s + } 153s > 153s > TestMorphIdentity(morph()) 153s [1] TRUE 153s > TestMorphIdentity(morph.identity()) 153s [1] TRUE 153s > 153s > TestMorphIdentityOutfun <- function(m) { 153s + f <- m$outfun(NULL) 153s + x <- 1:20 153s + if (!identical(x, f(x))) 153s + return(FALSE) 153s + f <- m$outfun(c(6, 8)) 153s + if (!identical(x[c(6, 8)], f(x))) 153s + return(FALSE) 153s + i <- rep(FALSE, 20) 153s + i[c(1, 3, 5)] <- TRUE 153s + f <- m$outfun(i) 153s + if (!identical(x[i], f(x))) 153s + return(FALSE) 153s + return(TRUE) 153s + } 153s > 153s > TestMorphIdentityOutfun(morph()) 153s [1] TRUE 153s > TestMorphIdentityOutfun(morph.identity()) 153s [1] TRUE 153s > 153s > # make sure that morph and morph.identity give back the same things 153s > all.equal(sort(names(morph.identity())), sort(names(morph(b=1)))) 153s [1] TRUE 153s > 153s > # test center parameter, univariate version 153s > zero.func <- function(x) 0 153s > center <- 2 153s > x <- seq(-1,1, length.out=15) 153s > morph.center <- morph(center=center) 153s > all.equal(sapply(x, morph.center$transform), x-center) 153s [1] TRUE 153s > all.equal(sapply(x, morph.center$inverse), x+center) 153s [1] TRUE 153s > all.equal(sapply(x, morph.center$lud(function(y) dnorm(y, log=TRUE))), 153s + dnorm(x, log=TRUE, mean=-2)) 153s [1] TRUE 153s > 153s > # test center parameter, multivariate version 153s > center <- 1:4 153s > x <- rep(0, 4) 153s > morph.center <- morph(center=center) 153s > lud.mult.dnorm <- function(x) prod(dnorm(x, log=TRUE)) 153s > all.equal(morph.center$transform(x), x-center) 153s [1] TRUE 153s > all.equal(morph.center$inverse(x), x+center) 153s [1] TRUE 153s > all.equal(morph.center$lud(lud.mult.dnorm)(x), 153s + lud.mult.dnorm(x - center)) 153s [1] TRUE 153s > # test 'r'. 153s > r <- 1 153s > morph.r <- morph(r=r) 153s > x <- seq(-1, 1, length.out=20) 153s > all.equal(sapply(x, morph.r$lud(function(x) dnorm(x, log=TRUE))), 153s + dnorm(x, log=TRUE)) 153s [1] TRUE 153s > x <- seq(1.1, 2, length.out=10) 153s > all(sapply(x, morph.r$lud(function(x) dnorm(x, log=TRUE))) 153s + != 153s + dnorm(x, log=TRUE)) 153s [1] TRUE 153s > 153s > TestExponentialEvenPWithRInverse <- function() { 153s + r <- 0.3 153s + p <- 2.2 153s + morph.r <- morph(r=r, p=p) 153s + x <- seq(0, r, length.out=20) 153s + all.equal(x, sapply(x, morph.r$inverse)) 153s + } 153s > 153s > TestExponentialEvenPWithRInverse() 153s [1] TRUE 153s > 153s > # make sure morph$lud passes '...' arguments. 153s > mean <- 2 153s > ident.morph <- morph() 153s > dnorm.morph <- ident.morph$lud(function(x, mean=0) 153s + dnorm(x, mean=mean, log=TRUE)) 153s > all.equal(dnorm.morph(2, mean), dnorm(2, mean=mean, log=TRUE)) 153s [1] TRUE 153s > x <- seq(-3, 3, length.out=20) 153s > m2 <- morph(r=10) 153s > dnorm.morph <- m2$lud(function(x, mean) 153s + dnorm(x, mean=mean, log=TRUE)) 153s > all.equal(sapply(x, function(y) dnorm.morph(y, 2)), 153s + dnorm(x, mean=2, log=TRUE)) 153s [1] TRUE 153s > 153s > # make sure morph$outfun passes '...' arguments. 153s > outfun.orig <- function(x, mean) x + mean 153s > ident.morph <- morph() 153s > mean <- 1 153s > outfun.morph <- ident.morph$outfun(outfun.orig) 153s > all.equal(outfun.morph(1:10, mean), 1:10+mean) 153s [1] TRUE 153s > 153s > m2 <- morph(r=10) 153s > outfun.morph <- m2$outfun(outfun.orig) 153s > all.equal(sapply(1:10, function(x) outfun.morph(x, mean)), 1:10+mean) 153s [1] TRUE 153s > 153s > ########################################################################### 153s > # test built-in exponential and polynomial transformations. 153s > f <- morph(b=3) 153s > x <- seq(0, 10, length.out=100) 153s > all.equal(x, sapply(sapply(x, f$transform), f$inverse)) 153s [1] TRUE 153s > 153s > f <- morph(p=3) 153s > all.equal(x, sapply(sapply(x, f$transform), f$inverse)) 153s [1] TRUE 153s > 153s > f <- morph(p=3, r=10) 153s > all.equal(-10:10, Vectorize(f$transform)(-10:10)) 153s [1] TRUE 153s > 153s > f <- morph(p=3, b=1) 153s > all.equal(x, sapply(sapply(x, f$transform), f$inverse)) 154s [1] TRUE 154s > 154s BEGIN TEST tests/morph.metrop.R 154s 154s R version 4.3.2 (2023-10-31) -- "Eye Holes" 154s Copyright (C) 2023 The R Foundation for Statistical Computing 154s Platform: aarch64-unknown-linux-gnu (64-bit) 154s 154s R is free software and comes with ABSOLUTELY NO WARRANTY. 154s You are welcome to redistribute it under certain conditions. 154s Type 'license()' or 'licence()' for distribution details. 154s 154s R is a collaborative project with many contributors. 154s Type 'contributors()' for more information and 154s 'citation()' on how to cite R or R packages in publications. 154s 154s Type 'demo()' for some demos, 'help()' for on-line help, or 154s 'help.start()' for an HTML browser interface to help. 154s Type 'q()' to quit R. 154s 154s > library(mcmc) 154s > 154s > .morph.unmorph <- mcmc:::.morph.unmorph 154s > 154s > ########################################################################### 154s > # basic functionality check, can morph.metro run? Can we change the 154s > # transformation? 154s > set.seed(42) 154s > obj <- morph.metrop(function(x) dt(x, df=3, log=TRUE), 154s + 100, 100, morph=morph(b=3)) 154s > obj <- morph.metrop(obj, morph=morph(b=1)) 154s > 154s > obj <- morph.metrop(function(x) prod(dt(x, df=3, log=TRUE)), 154s + rep(100, 3), 100, morph=morph(p=3, b=1)) 154s > obj <- morph.metrop(obj, morph=morph(r=1, p=3, b=1)) 154s > 154s > all.equal(class(obj), c("mcmc", "morph.metropolis")) 154s [1] TRUE 154s > 154s > ########################################################################### 154s > # check .morph.unmorph 154s > obj <- list(final=10) 154s > outfun <- function(x) x 154s > m <- morph(p=3) 154s > obj <- .morph.unmorph(obj, m, outfun) 154s > all.equal(class(obj), c("mcmc", "morph.metropolis")) 154s [1] TRUE 154s > all.equal(sort(names(obj)), 154s + sort(c("final", "morph", "morph.final", "outfun"))) 154s [1] TRUE 154s > all.equal(c(obj$final, obj$morph.final), c(m$inverse(10), 10)) 154s [1] TRUE 154s > all.equal(obj$outfun, outfun) 154s [1] TRUE 154s > all.equal(obj$morph, m) 154s [1] TRUE 154s > 154s BEGIN TEST tests/morphtoo.R 154s 154s R version 4.3.2 (2023-10-31) -- "Eye Holes" 154s Copyright (C) 2023 The R Foundation for Statistical Computing 154s Platform: aarch64-unknown-linux-gnu (64-bit) 154s 154s R is free software and comes with ABSOLUTELY NO WARRANTY. 154s You are welcome to redistribute it under certain conditions. 154s Type 'license()' or 'licence()' for distribution details. 154s 154s R is a collaborative project with many contributors. 154s Type 'contributors()' for more information and 154s 'citation()' on how to cite R or R packages in publications. 154s 154s Type 'demo()' for some demos, 'help()' for on-line help, or 154s 'help.start()' for an HTML browser interface to help. 154s Type 'q()' to quit R. 154s 154s > 154s > library(mcmc) 154s > 154s > x <- seq(0, 10, length = 10001) 154s > 154s > ### sub-exponentially light transformation 154s > 154s > b <- 0.5 154s > fsub <- morph(b = b) 154s > 154s > y <- unlist(Map(fsub$inverse, x)) 154s > 154s > myfsub <- function(x) ifelse(x > 1 / b, exp(b * x) - exp(1) / 3, 154s + (x * b)^3 * exp(1) / 6 + x * b * exp(1) / 2) 154s > y2 <- myfsub(x) 154s > all.equal(y, y2, tolerance = 1e-14) 154s [1] TRUE 154s > 154s > z <- unlist(Map(fsub$transform, y)) 154s > all.equal(z, x, tolerance = 1e-14) 154s [1] TRUE 154s > 154s > ### exponentially light transformation 154s > 154s > r <- 5 154s > p <- 3 154s > fp3 <- morph(r = r) 154s > 154s > y <- unlist(Map(fp3$inverse, x)) 154s > 154s > myfp3 <- function(x) ifelse(x < r, x, x + (x - r)^p) 154s > y2 <- myfp3(x) 154s > all.equal(y, y2, tolerance = 1e-14) 154s [1] TRUE 154s > 154s > z <- unlist(Map(fp3$transform, y)) 154s > all.equal(z, x, tolerance = 1e-12) 154s [1] TRUE 154s > 154s > ### both together 154s > 154s > fboth <- morph(b = b, r = r) 154s > 154s > y <- unlist(Map(fboth$inverse, x)) 154s > y2 <- myfsub(myfp3(x)) 154s > all.equal(y, y2, tolerance = 1e-14) 154s [1] TRUE 154s > 154s > z <- unlist(Map(fboth$transform, y)) 154s > all.equal(z, x, tolerance = 1e-12) 154s [1] TRUE 154s > 154s > ### exponentially light transformation with p != 3 154s > 154s > r <- 5 154s > p <- 2.2 154s > fpo <- morph(r = r, p = p) 154s > 154s > y <- unlist(Map(fpo$inverse, x)) 154s > 154s > myfpo <- function(x) ifelse(x < r, x, x + (x - r)^p) 154s > y2 <- myfpo(x) 154s > all.equal(y, y2, tolerance = 1e-14) 154s [1] TRUE 154s > 154s > z <- unlist(Map(fpo$transform, y)) 155s > all.equal(z, x, tolerance = 1e-14) 155s [1] TRUE 155s > 155s > 155s BEGIN TEST tests/saveseed.R 155s 155s R version 4.3.2 (2023-10-31) -- "Eye Holes" 155s Copyright (C) 2023 The R Foundation for Statistical Computing 155s Platform: aarch64-unknown-linux-gnu (64-bit) 155s 155s R is free software and comes with ABSOLUTELY NO WARRANTY. 155s You are welcome to redistribute it under certain conditions. 155s Type 'license()' or 'licence()' for distribution details. 155s 155s R is a collaborative project with many contributors. 155s Type 'contributors()' for more information and 155s 'citation()' on how to cite R or R packages in publications. 155s 155s Type 'demo()' for some demos, 'help()' for on-line help, or 155s 'help.start()' for an HTML browser interface to help. 155s Type 'q()' to quit R. 155s 155s > 155s > library(mcmc) 155s > 155s > set.seed(42) 155s > 155s > h <- function(x) if (all(x >= 0) && sum(x) <= 1) return(1) else return(-Inf) 155s > out <- metrop(h, initial = rep(0, 5), nbatch = 100, blen = 17, nspac = 3, 155s + scale = 0.1) 155s > 155s > save.seed <- .Random.seed 155s > 155s > out1 <- metrop(out) 155s > out2 <- metrop(out1) 155s > out3 <- metrop(out, nbatch = 2 * out$nbatch) 155s > 155s > fred <- rbind(out1$batch, out2$batch) 155s > identical(fred, out3$batch) 155s [1] TRUE 155s > 155s > 155s BEGIN TEST tests/saveseedmorph.R 155s 155s R version 4.3.2 (2023-10-31) -- "Eye Holes" 155s Copyright (C) 2023 The R Foundation for Statistical Computing 155s Platform: aarch64-unknown-linux-gnu (64-bit) 155s 155s R is free software and comes with ABSOLUTELY NO WARRANTY. 155s You are welcome to redistribute it under certain conditions. 155s Type 'license()' or 'licence()' for distribution details. 155s 155s R is a collaborative project with many contributors. 155s Type 'contributors()' for more information and 155s 'citation()' on how to cite R or R packages in publications. 155s 155s Type 'demo()' for some demos, 'help()' for on-line help, or 155s 'help.start()' for an HTML browser interface to help. 155s Type 'q()' to quit R. 155s 155s > 155s > library(mcmc) 155s > 155s > set.seed(42) 155s > 155s > h <- function(x) if (all(x >= 0) && sum(x) <= 1) return(1) else return(-Inf) 155s > out <- morph.metrop(obj = h, initial = rep(0, 5), nbatch = 100, blen = 17, 155s + nspac = 3, scale = 0.1) 155s > 155s > out1 <- morph.metrop(out) 155s > out2 <- morph.metrop(out1) 155s > out3 <- morph.metrop(out, nbatch = 2 * out$nbatch) 155s > 155s > fred <- rbind(out1$batch, out2$batch) 155s > identical(fred, out3$batch) 155s [1] TRUE 155s > 155s > out <- morph.metrop(out, morph = morph(p = 2.2, r = 0.3)) 155s > 155s > out1 <- morph.metrop(out) 155s > out2 <- morph.metrop(out1) 155s > out3 <- morph.metrop(out, nbatch = 2 * out$nbatch) 155s > 155s > fred <- rbind(out1$batch, out2$batch) 155s > identical(fred, out3$batch) 155s [1] TRUE 155s > 155s > 155s BEGIN TEST tests/temp-par-witch.R 156s 156s R version 4.3.2 (2023-10-31) -- "Eye Holes" 156s Copyright (C) 2023 The R Foundation for Statistical Computing 156s Platform: aarch64-unknown-linux-gnu (64-bit) 156s 156s R is free software and comes with ABSOLUTELY NO WARRANTY. 156s You are welcome to redistribute it under certain conditions. 156s Type 'license()' or 'licence()' for distribution details. 156s 156s R is a collaborative project with many contributors. 156s Type 'contributors()' for more information and 156s 'citation()' on how to cite R or R packages in publications. 156s 156s Type 'demo()' for some demos, 'help()' for on-line help, or 156s 'help.start()' for an HTML browser interface to help. 156s Type 'q()' to quit R. 156s 156s > 156s > if ((! exists("DEBUG")) || (! identical(DEBUG, TRUE))) DEBUG <- FALSE 156s > 156s > library(mcmc) 156s > 156s > options(digits=4) # avoid rounding differences 156s > 156s > set.seed(42) 156s > 156s > save.initial.seed <- .Random.seed 156s > 156s > d <- 3 156s > witch.which <- 1 - (1 / 2)^(1 / d) * (1 / 4)^(seq(0, 5) / d) 156s > witch.which 156s [1] 0.2063 0.5000 0.6850 0.8016 0.8750 0.9213 156s > 156s > ncomp <- length(witch.which) 156s > 156s > neighbors <- matrix(FALSE, ncomp, ncomp) 156s > neighbors[row(neighbors) == col(neighbors) + 1] <- TRUE 156s > neighbors[row(neighbors) == col(neighbors) - 1] <- TRUE 156s > neighbors[row(neighbors) == col(neighbors) + 2] <- TRUE 156s > neighbors[row(neighbors) == col(neighbors) - 2] <- TRUE 156s > 156s > ludfun <- function(state) { 156s + stopifnot(is.numeric(state)) 156s + stopifnot(length(state) == d + 1) 156s + icomp <- state[1] 156s + stopifnot(icomp == as.integer(icomp)) 156s + stopifnot(1 <= icomp && icomp <= ncomp) 156s + theta <- state[-1] 156s + if (any(abs(theta) > 1.0)) return(-Inf) 156s + bnd <- witch.which[icomp] 156s + if(bnd >= 1.0) 156s + stop(sprintf("witch.which[%d] >= 1.0", icomp)) 156s + if(bnd <= 0.0) 156s + stop(sprintf("witch.which[%d] <= 0.0", icomp)) 156s + if (all(abs(theta) > bnd)) 156s + return(- (d + 1) * log(2) - d * log(1 - bnd)) 156s + return(- (d + 1) * log(2) - log1p(- (1 - bnd)^d)) 156s + } 156s > 156s > thetas <- matrix(0, ncomp, d) 156s > out <- temper(ludfun, initial = thetas, neighbors = neighbors, nbatch = 50, 156s + blen = 13, nspac = 7, scale = 0.3456789, parallel = TRUE, debug = DEBUG) 156s > 156s > names(out) 156s [1] "lud" "neighbors" "nbatch" "blen" "nspac" 156s [6] "scale" "outfun" "debug" "parallel" "initial.seed" 156s [11] "final.seed" "time" "batch" "acceptx" "accepti" 156s [16] "initial" "final" 156s > 156s > out$acceptx 156s [1] 0.6336 0.4974 0.3245 0.6022 0.6130 0.5914 156s > 156s > out$accepti 156s [,1] [,2] [,3] [,4] [,5] [,6] 156s [1,] NA 0.7051 0.5497 NA NA NA 156s [2,] 0.7523 NA 0.5547 0.6288 NA NA 156s [3,] 0.5794 0.5865 NA 0.5309 0.5476 NA 156s [4,] NA 0.6667 0.5506 NA 0.8272 0.6837 156s [5,] NA NA 0.5439 0.8926 NA 0.8374 156s [6,] NA NA NA 0.8391 0.9023 NA 156s > 156s > ### check that have prob 1 / 2 for corners 156s > 156s > outfun <- function(state) { 156s + stopifnot(is.matrix(state)) 156s + ncomp <- nrow(state) 156s + d <- ncol(state) 156s + foo <- sweep(abs(state), 1, witch.which) 156s + bar <- apply(foo > 0, 1, all) 156s + return(as.numeric(bar)) 156s + } 156s > 156s > out2 <- temper(out, outfun = outfun) 156s > 156s > colMeans(out2$batch) 156s [1] 0.54923 0.40923 0.39538 0.09692 0.12923 0.60000 156s > apply(out2$batch, 2, sd) / sqrt(out$nbatch) 156s [1] 0.03482 0.04817 0.05464 0.02856 0.02113 0.05131 156s > 156s > ### try again 156s > 156s > out3 <- temper(out2, blen = 103) 157s > 157s > foo <- cbind(colMeans(out3$batch), 157s + apply(out3$batch, 2, sd) / sqrt(out$nbatch)) 157s > colnames(foo) <- c("means", "MCSE") 157s > foo 157s means MCSE 157s [1,] 0.5231 0.01390 157s [2,] 0.5361 0.02213 157s [3,] 0.4905 0.03961 157s [4,] 0.5652 0.04909 157s [5,] 0.4056 0.05107 157s [6,] 0.2450 0.05108 157s > 157s > 157s BEGIN TEST tests/temp-par.R 157s 157s R version 4.3.2 (2023-10-31) -- "Eye Holes" 157s Copyright (C) 2023 The R Foundation for Statistical Computing 157s Platform: aarch64-unknown-linux-gnu (64-bit) 157s 157s R is free software and comes with ABSOLUTELY NO WARRANTY. 157s You are welcome to redistribute it under certain conditions. 157s Type 'license()' or 'licence()' for distribution details. 157s 157s R is a collaborative project with many contributors. 157s Type 'contributors()' for more information and 157s 'citation()' on how to cite R or R packages in publications. 157s 157s Type 'demo()' for some demos, 'help()' for on-line help, or 157s 'help.start()' for an HTML browser interface to help. 157s Type 'q()' to quit R. 157s 157s > 157s > library(mcmc) 157s > 157s > set.seed(42) 157s > 157s > data(foo) 157s > attach(foo) 157s > 157s > out <- glm(y ~ x1 + x2 + x3, family = binomial, x = TRUE) 157s > ## IGNORE_RDIFF_BEGIN 157s > summary(out) 157s 157s Call: 157s glm(formula = y ~ x1 + x2 + x3, family = binomial, x = TRUE) 157s 157s Coefficients: 157s Estimate Std. Error z value Pr(>|z|) 157s (Intercept) 0.5772 0.2766 2.087 0.036930 * 157s x1 0.3362 0.4256 0.790 0.429672 157s x2 0.8475 0.4701 1.803 0.071394 . 157s x3 1.5143 0.4426 3.422 0.000622 *** 157s --- 157s Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 157s 157s (Dispersion parameter for binomial family taken to be 1) 157s 157s Null deviance: 134.602 on 99 degrees of freedom 157s Residual deviance: 86.439 on 96 degrees of freedom 157s AIC: 94.439 157s 157s Number of Fisher Scoring iterations: 5 157s 157s > ## IGNORE_RDIFF_END 157s > 157s > modmat <- out$x 157s > 157s > models <- cbind(rep(0:1, each = 4), rep(rep(0:1, times = 2), each = 2), 157s + rep(0:1, times = 4)) 157s > 157s > exes <- paste("x", 1:3, sep = "") 157s > betas <- NULL 157s > for (i in 1:nrow(models)) { 157s + inies <- as.logical(models[i, ]) 157s + foo <- exes[inies] 157s + bar <- paste("y ~", paste(foo, collapse = " + ")) 157s + if (! any(inies)) bar <- paste(bar, "1") 157s + baz <- glm(as.formula(bar), family = binomial) 157s + beta <- rep(0, 4) 157s + beta[c(TRUE, inies)] <- baz$coef 157s + betas <- rbind(betas, beta) 157s + } 157s > 157s > neighbors <- matrix(FALSE, nrow(models), nrow(models)) 157s > for (i in 1:nrow(neighbors)) { 157s + for (j in 1:ncol(neighbors)) { 157s + foo <- models[i, ] 157s + bar <- models[j, ] 157s + if (sum(foo != bar) == 1) neighbors[i, j] <- TRUE 157s + } 157s + } 158s > 158s > ludfun <- function(state, ...) { 158s + stopifnot(is.numeric(state)) 158s + stopifnot(length(state) == ncol(models) + 2) 158s + stopifnot(length(state) == ncol(models) + 2) 158s + icomp <- state[1] 158s + stopifnot(icomp == as.integer(icomp)) 158s + stopifnot(1 <= icomp && icomp <= nrow(models)) 158s + beta <- state[-1] 158s + inies <- c(TRUE, as.logical(models[icomp, ])) 158s + beta.logl <- beta 158s + beta.logl[! inies] <- 0 158s + eta <- as.numeric(modmat %*% beta.logl) 158s + logp <- ifelse(eta < 0, eta - log1p(exp(eta)), - log1p(exp(- eta))) 158s + logq <- ifelse(eta < 0, - log1p(exp(eta)), - eta - log1p(exp(- eta))) 158s + logl <- sum(logp[y == 1]) + sum(logq[y == 0]) 158s + val <- logl - sum(beta^2) / 2 158s + return(val) 158s + } 158s > 158s > ludval <- NULL 158s > for (i in 1:nrow(models)) ludval <- c(ludval, ludfun(c(i, betas[i, ]))) 158s > all(is.finite(ludval)) 158s [1] TRUE 158s > 158s > 158s > out <- temper(ludfun, initial = betas, neighbors = neighbors, nbatch = 20, 158s + blen = 10, nspac = 5, scale = 0.56789, parallel = TRUE, debug = TRUE) 158s > 158s > names(out) 158s [1] "lud" "neighbors" "nbatch" "blen" 158s [5] "nspac" "scale" "outfun" "debug" 158s [9] "parallel" "initial.seed" "final.seed" "time" 158s [13] "batch" "acceptx" "accepti" "initial" 158s [17] "final" "which" "unif.which" "state" 158s [21] "log.hastings" "unif.hastings" "proposal" "acceptd" 158s [25] "norm" "unif.choose" "coproposal" 158s > 158s > ### check decision about within-component or jump/swap 158s > 158s > identical(out$unif.which < 0.5, out$which) 158s [1] TRUE 158s > 158s > identical(out$which, out$proposal[ , 1] == out$coproposal[ , 1]) 158s [1] TRUE 158s > 158s > ### check proposal and coproposal are actually current state or part thereof 158s > 158s > prop <- out$proposal 158s > coprop <- out$coproposal 158s > prop.i <- prop[ , 1] 158s > coprop.i <- coprop[ , 1] 158s > alt.prop <- prop 158s > alt.coprop <- coprop 158s > for (i in 1:nrow(prop)) { 158s + alt.prop[i, ] <- c(prop.i[i], out$state[i, prop.i[i], ]) 158s + alt.coprop[i, ] <- c(coprop.i[i], out$state[i, coprop.i[i], ]) 158s + } 158s > identical(coprop, alt.coprop) 158s [1] TRUE 158s > identical(prop[! out$which, ], alt.prop[! out$which, ]) 158s [1] TRUE 158s > identical(prop[out$which, 1], alt.prop[out$which, 1]) 158s [1] TRUE 158s > 158s > ### check hastings ratio calculated correctly 158s > 158s > foo <- apply(prop, 1, ludfun) 158s > fooco <- apply(coprop, 1, ludfun) 158s > prop[ , 1] <- out$coproposal[ , 1] 158s > coprop[ , 1] <- out$proposal[ , 1] 158s > foo.swap <- apply(prop, 1, ludfun) 158s > fooco.swap <- apply(coprop, 1, ludfun) 158s > log.haste <- ifelse(out$which, foo - fooco, 158s + foo.swap + fooco.swap - foo - fooco) 158s > all.equal(log.haste, out$log.hastings) 158s [1] TRUE 158s > 158s > ### check hastings rejection decided correctly 158s > 158s > identical(out$log.hastings >= 0, is.na(out$unif.hastings)) 158s [1] TRUE 158s > all(out$log.hastings < 0 | out$acceptd) 158s [1] TRUE 158s > identical(out$acceptd, 158s + out$log.hastings >= 0 | out$unif.hastings < exp(out$log.hastings)) 158s [1] TRUE 158s > 158s > ### check acceptance carried out or not (according to decision) correctly 158s > 158s > before <- out$state 158s > after <- before 158s > after[- dim(after)[1], , ] <- before[-1, , ] 158s > after[dim(after)[1], , ] <- out$final 158s > my.after <- before 158s > for (i in 1:length(out$acceptd)) { 158s + if (out$acceptd[i]) { 158s + if (out$which[i]) { 158s + j <- out$proposal[i, 1] 158s + my.after[i, j, ] <- out$proposal[i, -1] 158s + } else { 158s + j <- out$proposal[i, 1] 158s + k <- out$coproposal[i, 1] 158s + my.after[i, j, ] <- out$coproposal[i, -1] 158s + my.after[i, k, ] <- out$proposal[i, -1] 158s + } 158s + } 158s + } 158s > identical(after, my.after) 158s [1] TRUE 158s > 158s > ### check within-component proposal 158s > 158s > my.coproposal.within <- out$coproposal[out$which, ] 158s > proposal.within <- out$proposal[out$which, ] 158s > my.z <- out$norm[out$which, ] 158s > my.proposal.within <- my.coproposal.within 158s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + out$scale * my.z 158s > all.equal(proposal.within, my.proposal.within) 158s [1] TRUE 158s > 158s > my.unif.choose <- out$unif.choose[out$which, 1] 158s > my.i <- floor(nrow(models) * my.unif.choose) + 1 158s > all(1 <= my.i & my.i <= nrow(models)) 158s [1] TRUE 158s > identical(my.i, my.coproposal.within[ , 1]) 158s [1] TRUE 158s > 158s > ### check swap proposal 158s > 158s > coproposal.swap <- out$coproposal[! out$which, ] 158s > proposal.swap <- out$proposal[! out$which, ] 158s > unif.choose.swap <- out$unif.choose[! out$which, ] 158s > my.i <- floor(nrow(models) * unif.choose.swap[ , 1]) + 1 158s > nneighbors <- apply(out$neighbors, 1, sum) 158s > my.nneighbors <- nneighbors[my.i] 158s > my.k <- floor(my.nneighbors * unif.choose.swap[ , 2]) + 1 158s > my.j <- my.k 158s > foo <- seq(1, ncol(out$neighbors)) 158s > for (i in seq(along = my.j)) { 158s + my.j[i] <- (foo[out$neighbors[my.i[i], ]])[my.k[i]] 158s + } 158s > identical(coproposal.swap[ , 1], my.i) 158s [1] TRUE 158s > identical(proposal.swap[ , 1], my.j) 158s [1] TRUE 158s > 158s > ### check standard normal and uniform random numbers are as purported 158s > 158s > save.Random.seed <- .Random.seed 158s > .Random.seed <- out$initial.seed 158s > 158s > nx <- ncol(out$initial) 158s > niter <- out$nbatch * out$blen * out$nspac 158s > my.norm <- matrix(NA, nrow = nrow(out$norm), ncol = ncol(out$norm)) 158s > my.unif.which <- rep(NA, niter) 158s > my.unif.hastings <- rep(NA, niter) 158s > my.unif.choose <- matrix(NA, niter, 2) 158s > for (iiter in 1:niter) { 158s + my.unif.which[iiter] <- runif(1) 158s + if (out$which[iiter]) { 158s + my.unif.choose[iiter, 1] <- runif(1) 158s + my.norm[iiter, ] <- rnorm(nx) 158s + if (out$log.hastings[iiter] < 0) my.unif.hastings[iiter] <- runif(1) 158s + } else { 158s + my.unif.choose[iiter, ] <- runif(2) 158s + if (out$log.hastings[iiter] < 0) my.unif.hastings[iiter] <- runif(1) 158s + } 158s + } 158s > identical(my.norm, out$norm) 158s [1] TRUE 158s > identical(my.unif.which, out$unif.which) 158s [1] TRUE 158s > identical(my.unif.hastings, out$unif.hastings) 158s [1] TRUE 158s > identical(my.unif.choose, out$unif.choose) 158s [1] TRUE 158s > 158s > .Random.seed <- save.Random.seed 158s > 158s > ### check batch means 158s > 158s > foo <- after[seq(1, niter) %% out$nspac == 0, , ] 158s > foo <- array(as.vector(foo), dim = c(out$blen, out$nbatch, dim(foo)[2:3])) 158s > foo <- apply(foo, c(2, 3, 4), mean) 158s > all.equal(foo, out$batch) 158s [1] TRUE 158s > 158s > ### check acceptance rates 158s > 158s > accept.within <- out$acceptd[out$which] 158s > my.i.within <- out$coproposal[out$which, 1] 158s > my.acceptx <- as.vector(sapply(split(accept.within, my.i.within), mean)) 158s > identical(my.acceptx, out$acceptx) 158s [1] TRUE 158s > 158s > accept.swap <- out$acceptd[! out$which] 158s > my.i.swap <- out$coproposal[! out$which, 1] 158s > my.j.swap <- out$proposal[! out$which, 1] 158s > nmodel <- nrow(out$neighbors) 158s > my.accepti <- matrix(NA, nmodel, nmodel) 158s > for (i in 1:nmodel) { 158s + for (j in 1:nmodel) { 158s + if (out$neighbors[i, j]) { 158s + my.accepti[i, j] <- 158s + mean(accept.swap[my.i.swap == i & my.j.swap == j]) 158s + } 158s + } 158s + } 158s > identical(my.accepti, out$accepti) 158s [1] TRUE 158s > 158s > ### check scale vector 158s > 158s > nx <- ncol(models) + 1 158s > newscale <- rnorm(nx, 0.5, 0.1) 158s > 158s > out <- temper(out, scale = newscale) 158s > 158s > my.coproposal.within <- out$coproposal[out$which, ] 158s > proposal.within <- out$proposal[out$which, ] 158s > my.z <- out$norm[out$which, ] 158s > my.proposal.within <- my.coproposal.within 158s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + 158s + sweep(my.z, 2, out$scale, "*") 158s > all.equal(proposal.within, my.proposal.within) 158s [1] TRUE 158s > 158s > ### check scale matrix 158s > 158s > matscale <- matrix(rnorm(nx * nx, 0.0, 0.1), nx, nx) 158s > diag(matscale) <- 0.56789 158s > 158s > out <- temper(out, scale = matscale) 158s > 158s > my.coproposal.within <- out$coproposal[out$which, ] 158s > proposal.within <- out$proposal[out$which, ] 158s > my.z <- out$norm[out$which, ] 158s > my.proposal.within <- my.coproposal.within 158s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + 158s + my.z %*% t(out$scale) 158s > all.equal(proposal.within, my.proposal.within) 158s [1] TRUE 158s > 158s > ### check scale list 158s > 158s > lisztscale <- list(0.56789, newscale, matscale, matscale, newscale, 158s + 0.98765, 0.98765, newscale) 158s > 158s > out <- temper(out, scale = lisztscale) 158s > 158s > my.coproposal.within <- out$coproposal[out$which, ] 158s > proposal.within <- out$proposal[out$which, ] 158s > my.z <- out$norm[out$which, ] 158s > my.proposal.within <- my.coproposal.within 158s > for (iiter in 1:nrow(my.z)) { 158s + my.i <- my.coproposal.within[iiter, 1] 158s + my.scale <- out$scale[[my.i]] 158s + if (is.matrix(my.scale)) { 158s + my.proposal.within[iiter, -1] <- my.coproposal.within[iiter, -1] + 158s + my.z[iiter, , drop = FALSE] %*% t(my.scale) 158s + } else { 158s + my.proposal.within[iiter, -1] <- my.coproposal.within[iiter, -1] + 158s + my.z[iiter, ] * my.scale 158s + } 158s + } 158s > all.equal(proposal.within, my.proposal.within) 158s [1] TRUE 158s > 158s > ### check outfun 158s > 158s > outfun <- function(state, icomp, ...) { 158s + stopifnot(is.matrix(state)) 158s + stopifnot(is.numeric(state)) 158s + nx <- ncol(betas) 158s + ncomp <- nrow(betas) 158s + stopifnot(ncol(state) == nx) 158s + stopifnot(nrow(state) == ncomp) 158s + stopifnot(1 <= icomp && icomp <= ncomp) 158s + foo <- state[icomp, ] 158s + bar <- foo^2 158s + return(c(foo, bar)) 158s + } 158s > 158s > out <- temper(out, outfun = outfun, icomp = 4) 158s > 158s > before <- out$state 158s > after <- before 158s > after[- dim(after)[1], , ] <- before[-1, , ] 158s > after[dim(after)[1], , ] <- out$final 158s > outies <- apply(after, 1, outfun, icomp = 4) 159s > outies <- t(outies) 159s > 159s > foo <- outies[seq(1, niter) %% out$nspac == 0, ] 159s > foo <- array(as.vector(foo), dim = c(out$blen, out$nbatch, dim(foo)[2])) 159s > foo <- apply(foo, c(2, 3), mean) 159s > all.equal(foo, out$batch) 159s [1] TRUE 159s > 159s > 159s BEGIN TEST tests/temp-ser-witch.R 159s 159s R version 4.3.2 (2023-10-31) -- "Eye Holes" 159s Copyright (C) 2023 The R Foundation for Statistical Computing 159s Platform: aarch64-unknown-linux-gnu (64-bit) 159s 159s R is free software and comes with ABSOLUTELY NO WARRANTY. 159s You are welcome to redistribute it under certain conditions. 159s Type 'license()' or 'licence()' for distribution details. 159s 159s R is a collaborative project with many contributors. 159s Type 'contributors()' for more information and 159s 'citation()' on how to cite R or R packages in publications. 159s 159s Type 'demo()' for some demos, 'help()' for on-line help, or 159s 'help.start()' for an HTML browser interface to help. 159s Type 'q()' to quit R. 159s 159s > 159s > library(mcmc) 159s > 159s > set.seed(42) 159s > 159s > d <- 3 159s > witch.which <- 1 - (1 / 2)^(1 / d) * (1 / 4)^(seq(0, 5) / d) 159s > witch.which 159s [1] 0.2062995 0.5000000 0.6850197 0.8015749 0.8750000 0.9212549 159s > 159s > ncomp <- length(witch.which) 159s > 159s > neighbors <- matrix(FALSE, ncomp, ncomp) 159s > neighbors[row(neighbors) == col(neighbors) + 1] <- TRUE 159s > neighbors[row(neighbors) == col(neighbors) - 1] <- TRUE 159s > neighbors[row(neighbors) == col(neighbors) + 2] <- TRUE 159s > neighbors[row(neighbors) == col(neighbors) - 2] <- TRUE 159s > 159s > ludfun <- function(state) { 159s + stopifnot(is.numeric(state)) 159s + stopifnot(length(state) == d + 1) 159s + icomp <- state[1] 159s + stopifnot(icomp == as.integer(icomp)) 159s + stopifnot(1 <= icomp && icomp <= ncomp) 159s + theta <- state[-1] 159s + if (any(abs(theta) > 1.0)) return(-Inf) 159s + bnd <- witch.which[icomp] 159s + if(bnd >= 1.0) 159s + stop(sprintf("witch.which[%d] >= 1.0", icomp)) 159s + if(bnd <= 0.0) 159s + stop(sprintf("witch.which[%d] <= 0.0", icomp)) 159s + if (all(abs(theta) > bnd)) 159s + return(- (d + 1) * log(2) - d * log(1 - bnd)) 159s + return(- (d + 1) * log(2) - log1p(- (1 - bnd)^d)) 159s + } 159s > 159s > initial <- c(1, rep(0, d)) 159s > 159s > out <- temper(ludfun, initial = initial, neighbors = neighbors, 159s + nbatch = 50, blen = 13, nspac = 7, scale = 0.3456789) 159s > 159s > names(out) 159s [1] "lud" "neighbors" "nbatch" "blen" "nspac" 159s [6] "scale" "outfun" "debug" "parallel" "initial.seed" 159s [11] "final.seed" "time" "batch" "acceptx" "accepti" 159s [16] "initial" "final" "ibatch" 159s > 159s > out$acceptx 159s [1] 0.6388889 0.4385246 0.3631714 0.4885246 0.4709677 0.4735516 159s > 159s > out$accepti 159s [,1] [,2] [,3] [,4] [,5] [,6] 159s [1,] NA 0.5071770 0.2727273 NA NA NA 159s [2,] 0.7070064 NA 0.4355828 0.4186047 NA NA 159s [3,] 0.5816327 0.8039216 NA 0.5888889 0.5662651 NA 159s [4,] NA 0.7415730 0.8571429 NA 0.7857143 0.6626506 159s [5,] NA NA 0.5204082 0.6516854 NA 0.8378378 159s [6,] NA NA NA 0.3515152 0.5056818 NA 159s > 159s > colMeans(out$ibatch) 159s [1] 0.1830769 0.2153846 0.1630769 0.1369231 0.1353846 0.1661538 159s > 159s > ### check that have prob 1 / 2 for corners 159s > 159s > outfun <- function(state) { 159s + stopifnot(is.numeric(state)) 159s + icomp <- state[1] 159s + stopifnot(icomp == as.integer(icomp)) 159s + stopifnot(1 <= icomp && icomp <= length(witch.which)) 159s + theta <- state[-1] 159s + foo <- all(abs(theta) > witch.which[icomp]) 159s + bar <- rep(0, length(witch.which)) 159s + baz <- rep(0, length(witch.which)) 159s + bar[icomp] <- as.numeric(foo) 159s + baz[icomp] <- 1 159s + return(c(bar, baz)) 159s + } 159s > 159s > out <- temper(out, blen = 103, outfun = outfun, debug = TRUE) 159s > 159s > eta.batch <- out$batch[ , seq(1, ncomp)] 159s > noo.batch <- out$batch[ , seq(ncomp + 1, ncomp + ncomp)] 159s > eta <- colMeans(eta.batch) 159s > noo <- colMeans(noo.batch) 159s > mu <- eta / noo 159s > eta 159s [1] 0.06660194 0.06388350 0.05766990 0.06563107 0.10368932 0.22912621 159s > noo 159s [1] 0.1365049 0.1258252 0.1293204 0.1370874 0.1716505 0.2996117 159s > mu 159s [1] 0.4879090 0.5077160 0.4459459 0.4787535 0.6040724 0.7647440 159s > 159s > eta.batch.rel <- sweep(eta.batch, 2, eta, "/") 159s > noo.batch.rel <- sweep(noo.batch, 2, noo, "/") 159s > mu.batch.rel <- eta.batch.rel - noo.batch.rel 159s > 159s > mu.mcse.rel <- apply(mu.batch.rel, 2, sd) / sqrt(out$nbatch) 159s > mu.mcse.rel 159s [1] 0.05010927 0.07897321 0.09678339 0.12636113 0.11261781 0.07082685 159s > 159s > foo <- cbind(mu, mu * mu.mcse.rel) 159s > colnames(foo) <- c("means", "MCSE") 159s > foo 159s means MCSE 159s [1,] 0.4879090 0.02444876 159s [2,] 0.5077160 0.04009596 159s [3,] 0.4459459 0.04316016 159s [4,] 0.4787535 0.06049584 159s [5,] 0.6040724 0.06802931 159s [6,] 0.7647440 0.05416441 159s > 159s > ### check decision about within-component or jump/swap 159s > 159s > identical(out$unif.which < 0.5, out$which) 159s [1] TRUE 159s > 159s > identical(out$which, out$proposal[ , 1] == out$state[ , 1]) 159s [1] TRUE 159s > 159s > ### check hastings ratio calculated correctly 159s > 159s > n <- apply(neighbors, 1, sum) 159s > i <- out$state[ , 1] 159s > istar <- out$proposal[ , 1] 159s > foo <- apply(out$state, 1, ludfun) 160s > bar <- apply(out$proposal, 1, ludfun) 161s > my.log.hastings <- bar - foo - log(n[istar]) + log(n[i]) 161s > all.equal(my.log.hastings, out$log.hastings) 161s [1] TRUE 161s > 161s > 161s BEGIN TEST tests/temp-ser.R 161s 161s R version 4.3.2 (2023-10-31) -- "Eye Holes" 161s Copyright (C) 2023 The R Foundation for Statistical Computing 161s Platform: aarch64-unknown-linux-gnu (64-bit) 161s 161s R is free software and comes with ABSOLUTELY NO WARRANTY. 161s You are welcome to redistribute it under certain conditions. 161s Type 'license()' or 'licence()' for distribution details. 161s 161s R is a collaborative project with many contributors. 161s Type 'contributors()' for more information and 161s 'citation()' on how to cite R or R packages in publications. 161s 161s Type 'demo()' for some demos, 'help()' for on-line help, or 161s 'help.start()' for an HTML browser interface to help. 161s Type 'q()' to quit R. 161s 161s > 161s > library(mcmc) 161s > 161s > set.seed(42) 161s > 161s > data(foo) 161s > attach(foo) 161s > 161s > out <- glm(y ~ x1 + x2 + x3, family = binomial, x = TRUE) 161s > ## IGNORE_RDIFF_BEGIN 161s > summary(out) 161s 161s Call: 161s glm(formula = y ~ x1 + x2 + x3, family = binomial, x = TRUE) 161s 161s Coefficients: 161s Estimate Std. Error z value Pr(>|z|) 161s (Intercept) 0.5772 0.2766 2.087 0.036930 * 161s x1 0.3362 0.4256 0.790 0.429672 161s x2 0.8475 0.4701 1.803 0.071394 . 161s x3 1.5143 0.4426 3.422 0.000622 *** 161s --- 161s Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 161s 161s (Dispersion parameter for binomial family taken to be 1) 161s 161s Null deviance: 134.602 on 99 degrees of freedom 161s Residual deviance: 86.439 on 96 degrees of freedom 161s AIC: 94.439 161s 161s Number of Fisher Scoring iterations: 5 161s 161s > ## IGNORE_RDIFF_END 161s > 161s > modmat <- out$x 161s > 161s > models <- cbind(rep(0:1, each = 4), rep(rep(0:1, times = 2), each = 2), 161s + rep(0:1, times = 4)) 161s > 161s > exes <- paste("x", 1:3, sep = "") 161s > models[nrow(models), ] 161s [1] 1 1 1 161s > beta.initial <- c(nrow(models), out$coefficients) 161s > 161s > neighbors <- matrix(FALSE, nrow(models), nrow(models)) 161s > for (i in 1:nrow(neighbors)) { 161s + for (j in 1:ncol(neighbors)) { 161s + foo <- models[i, ] 161s + bar <- models[j, ] 161s + if (sum(foo != bar) == 1) neighbors[i, j] <- TRUE 161s + } 161s + } 161s > neighbors 161s [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] 161s [1,] FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE 161s [2,] TRUE FALSE FALSE TRUE FALSE TRUE FALSE FALSE 161s [3,] TRUE FALSE FALSE TRUE FALSE FALSE TRUE FALSE 161s [4,] FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE 161s [5,] TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE 161s [6,] FALSE TRUE FALSE FALSE TRUE FALSE FALSE TRUE 161s [7,] FALSE FALSE TRUE FALSE TRUE FALSE FALSE TRUE 161s [8,] FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE 161s > 161s > ludfun <- function(state, log.pseudo.prior, ...) { 161s + stopifnot(is.numeric(state)) 161s + stopifnot(length(state) == ncol(models) + 2) 161s + icomp <- state[1] 161s + stopifnot(icomp == as.integer(icomp)) 161s + stopifnot(1 <= icomp && icomp <= nrow(models)) 161s + stopifnot(is.numeric(log.pseudo.prior)) 161s + stopifnot(length(log.pseudo.prior) == nrow(models)) 161s + beta <- state[-1] 161s + inies <- c(TRUE, as.logical(models[icomp, ])) 161s + beta.logl <- beta 161s + beta.logl[! inies] <- 0 161s + eta <- as.numeric(modmat %*% beta.logl) 161s + logp <- ifelse(eta < 0, eta - log1p(exp(eta)), - log1p(exp(- eta))) 161s + logq <- ifelse(eta < 0, - log1p(exp(eta)), - eta - log1p(exp(- eta))) 161s + logl <- sum(logp[y == 1]) + sum(logq[y == 0]) 161s + val <- logl - sum(beta^2) / 2 + log.pseudo.prior[icomp] 161s + return(val) 161s + } 161s > 161s > qux <- c(25.01, 5.875, 9.028, 0.6959, 11.73, 2.367, 5.864, 0.0) 161s > 161s > out <- temper(ludfun, initial = beta.initial, neighbors = neighbors, 161s + nbatch = 25, blen = 20, nspac = 5, scale = 0.56789, debug = TRUE, 161s + log.pseudo.prior = qux) 161s > 161s > names(out) 161s [1] "lud" "neighbors" "nbatch" "blen" 161s [5] "nspac" "scale" "outfun" "debug" 161s [9] "parallel" "initial.seed" "final.seed" "time" 161s [13] "batch" "acceptx" "accepti" "initial" 161s [17] "final" "ibatch" "which" "unif.which" 161s [21] "state" "log.hastings" "unif.hastings" "proposal" 161s [25] "acceptd" "norm" "unif.choose" 161s > 161s > apply(out$ibatch, 2, mean) 161s [1] 0.776 0.170 0.000 0.006 0.024 0.010 0.004 0.010 161s > 161s > ### check decision about within-component or jump/swap 161s > 161s > identical(out$unif.which < 0.5, out$which) 161s [1] TRUE 161s > 161s > identical(out$which, out$proposal[ , 1] == out$state[ , 1]) 161s [1] TRUE 161s > 161s > ### check hastings ratio calculated correctly 161s > 161s > foo <- apply(out$state, 1, ludfun, log.pseudo.prior = qux) 161s > bar <- apply(out$proposal, 1, ludfun, log.pseudo.prior = qux) 161s > all.equal(bar - foo, out$log.hastings) 161s [1] TRUE 161s > 161s > ### check hastings rejection decided correctly 161s > 161s > identical(out$log.hastings >= 0, is.na(out$unif.hastings)) 161s [1] TRUE 161s > all(out$log.hastings < 0 | out$acceptd) 161s [1] TRUE 161s > identical(out$acceptd, 161s + out$log.hastings >= 0 | out$unif.hastings < exp(out$log.hastings)) 161s [1] TRUE 161s > 161s > ### check acceptance carried out or not (according to decision) correctly 161s > 161s > before <- out$state 161s > after <- before 161s > after[- dim(after)[1], ] <- before[-1, ] 161s > after[dim(after)[1], ] <- out$final 161s > my.after <- before 161s > my.after[out$acceptd, ] <- out$proposal[out$acceptd, ] 161s > identical(after, my.after) 161s [1] TRUE 161s > 161s > ### check within-component proposal 161s > 161s > my.coproposal.within <- out$state[out$which, ] 161s > proposal.within <- out$proposal[out$which, ] 161s > my.z <- out$norm[out$which, ] 161s > my.proposal.within <- my.coproposal.within 161s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + out$scale * my.z 161s > all.equal(proposal.within, my.proposal.within) 161s [1] TRUE 161s > 161s > ### check swap proposal 161s > 161s > coproposal.swap <- out$state[! out$which, ] 161s > proposal.swap <- out$proposal[! out$which, ] 161s > unif.choose.swap <- out$unif.choose[! out$which] 161s > my.i <- coproposal.swap[ , 1] 161s > nneighbors <- apply(out$neighbors, 1, sum) 161s > my.nneighbors <- nneighbors[my.i] 161s > my.k <- floor(my.nneighbors * unif.choose.swap) + 1 161s > my.j <- my.k 161s > foo <- seq(1, ncol(out$neighbors)) 161s > for (i in seq(along = my.j)) { 161s + my.j[i] <- (foo[out$neighbors[my.i[i], ]])[my.k[i]] 161s + } 161s > identical(coproposal.swap[ , 1], my.i) 161s [1] TRUE 161s > identical(proposal.swap[ , 1], my.j) 161s [1] TRUE 161s > 161s > ### check standard normal and uniform random numbers are as purported 161s > 161s > save.Random.seed <- .Random.seed 161s > .Random.seed <- out$initial.seed 161s > 161s > nx <- length(out$initial) - 1 161s > niter <- out$nbatch * out$blen * out$nspac 161s > my.norm <- matrix(NA, nrow = nrow(out$norm), ncol = ncol(out$norm)) 161s > my.unif.which <- rep(NA, niter) 161s > my.unif.hastings <- rep(NA, niter) 161s > my.unif.choose <- rep(NA, niter) 161s > for (iiter in 1:niter) { 161s + my.unif.which[iiter] <- runif(1) 161s + if (out$which[iiter]) { 161s + my.norm[iiter, ] <- rnorm(nx) 161s + if (out$log.hastings[iiter] < 0) my.unif.hastings[iiter] <- runif(1) 161s + } else { 161s + my.unif.choose[iiter] <- runif(1) 161s + if (out$log.hastings[iiter] < 0) my.unif.hastings[iiter] <- runif(1) 161s + } 161s + } 161s > identical(my.norm, out$norm) 161s [1] TRUE 161s > identical(my.unif.which, out$unif.which) 161s [1] TRUE 161s > identical(my.unif.hastings, out$unif.hastings) 161s [1] TRUE 161s > identical(my.unif.choose, out$unif.choose) 161s [1] TRUE 161s > 161s > .Random.seed <- save.Random.seed 161s > 161s > ### check batch means 161s > 161s > my.xstate <- after[ , -1] 161s > foo <- my.xstate[seq(1, niter) %% out$nspac == 0, ] 161s > foo <- array(as.vector(foo), dim = c(out$blen, out$nbatch, dim(foo)[2])) 161s > foo <- apply(foo, c(2, 3), mean) 161s > all.equal(foo, out$batch) 161s [1] TRUE 161s > 161s > ### check ibatch means 161s > 161s > my.istate <- after[ , 1] 161s > my.istate.matrix <- matrix(0, length(my.istate), nrow(models)) 161s > for (i in 1:nrow(my.istate.matrix)) 161s + my.istate.matrix[i, my.istate[i]] <- 1 161s > foo <- my.istate.matrix[seq(1, niter) %% out$nspac == 0, ] 161s > foo <- array(as.vector(foo), dim = c(out$blen, out$nbatch, dim(foo)[2])) 161s > foo <- apply(foo, c(2, 3), mean) 161s > all.equal(foo, out$ibatch) 161s [1] TRUE 161s > 161s > ### check acceptance rates 161s > 161s > nmodel <- nrow(out$neighbors) 161s > 161s > accept.within <- out$acceptd[out$which] 161s > my.i.within <- out$state[out$which, 1] 161s > my.i.within.accept <- my.i.within[accept.within] 161s > my.acceptx.numer <- tabulate(my.i.within.accept, nbins = nmodel) 161s > my.acceptx.denom <- tabulate(my.i.within, nbins = nmodel) 161s > my.acceptx <- my.acceptx.numer / my.acceptx.denom 161s > identical(my.acceptx, out$acceptx) 161s [1] TRUE 161s > 161s > accept.swap <- out$acceptd[! out$which] 161s > my.i.swap <- out$state[! out$which, 1] 161s > my.j.swap <- out$proposal[! out$which, 1] 161s > my.accepti <- matrix(NA, nmodel, nmodel) 161s > for (i in 1:nmodel) { 161s + for (j in 1:nmodel) { 161s + if (out$neighbors[i, j]) { 161s + my.accepti[i, j] <- 161s + mean(accept.swap[my.i.swap == i & my.j.swap == j]) 161s + } 161s + } 161s + } 161s > identical(my.accepti, out$accepti) 161s [1] TRUE 161s > 161s > ### check scale vector 161s > 161s > nx <- ncol(models) + 1 161s > newscale <- rnorm(nx, 0.5, 0.1) 161s > 161s > out <- temper(out, scale = newscale, log.pseudo.prior = qux) 162s > 162s > my.coproposal.within <- out$state[out$which, ] 162s > proposal.within <- out$proposal[out$which, ] 162s > my.z <- out$norm[out$which, ] 162s > my.proposal.within <- my.coproposal.within 162s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + 162s + sweep(my.z, 2, out$scale, "*") 162s > all.equal(proposal.within, my.proposal.within) 162s [1] TRUE 162s > 162s > ### check scale matrix 162s > 162s > matscale <- matrix(rnorm(nx * nx, 0.0, 0.1), nx, nx) 162s > diag(matscale) <- 0.56789 162s > 162s > out <- temper(out, scale = matscale, log.pseudo.prior = qux) 162s > 162s > my.coproposal.within <- out$state[out$which, ] 162s > proposal.within <- out$proposal[out$which, ] 162s > my.z <- out$norm[out$which, ] 162s > my.proposal.within <- my.coproposal.within 162s > my.proposal.within[ , -1] <- my.coproposal.within[ , -1] + 162s + my.z %*% t(out$scale) 162s > all.equal(proposal.within, my.proposal.within) 162s [1] TRUE 162s > 162s > ### check scale list 162s > 162s > lisztscale <- list(0.56789, newscale, matscale, matscale, newscale, 162s + 0.98765, 0.98765, newscale) 162s > 162s > out <- temper(out, scale = lisztscale, log.pseudo.prior = qux) 162s > 162s > my.coproposal.within <- out$state[out$which, ] 162s > proposal.within <- out$proposal[out$which, ] 162s > my.z <- out$norm[out$which, ] 162s > my.proposal.within <- my.coproposal.within 162s > for (iiter in 1:nrow(my.z)) { 162s + my.i <- my.coproposal.within[iiter, 1] 162s + my.scale <- out$scale[[my.i]] 162s + if (is.matrix(my.scale)) { 162s + my.proposal.within[iiter, -1] <- my.coproposal.within[iiter, -1] + 162s + my.z[iiter, , drop = FALSE] %*% t(my.scale) 162s + } else { 162s + my.proposal.within[iiter, -1] <- my.coproposal.within[iiter, -1] + 162s + my.z[iiter, ] * my.scale 162s + } 162s + } 162s > all.equal(proposal.within, my.proposal.within) 162s [1] TRUE 162s > 162s > ### check outfun 162s > 162s > outfun <- function(state, icomp) { 162s + stopifnot(is.matrix(state)) 162s + stopifnot(is.numeric(state)) 162s + nx <- ncol(initial) 162s + ncomp <- nrow(initial) 162s + stopifnot(ncol(state) == nx) 162s + stopifnot(nrow(state) == ncomp) 162s + stopifnot(1 <= icomp & icomp <= ncomp) 162s + foo <- state[icomp, ] 162s + bar <- foo^2 162s + return(c(foo, bar)) 162s + } 162s > 162s > ncomp <- nrow(models) 162s > nx <- length(beta.initial) - 1 162s > 162s > outfun <- function(state, icomp, ...) { 162s + stopifnot(is.numeric(state)) 162s + stopifnot(length(state) == nx + 1) 162s + istate <- state[1] 162s + stopifnot(istate == as.integer(istate)) 162s + stopifnot(1 <= istate && istate <= ncomp) 162s + stopifnot(1 <= icomp && icomp <= ncomp) 162s + if (istate == icomp) { 162s + foo <- state[-1] 162s + } else { 162s + foo <- rep(0, nx) 162s + } 162s + bar <- foo^2 162s + return(c(foo, bar)) 162s + } 162s > 162s > out <- temper(ludfun, initial = out$final, neighbors = neighbors, 162s + nbatch = 25, blen = 20, nspac = 5, scale = 0.56789, debug = TRUE, 162s + outfun = outfun, log.pseudo.prior = qux, icomp = 4) 162s > 162s > before <- out$state 162s > after <- before 162s > after[- dim(after)[1], ] <- before[-1, ] 162s > after[dim(after)[1], ] <- out$final 162s > outies <- apply(after, 1, outfun, icomp = 4) 162s > outies <- t(outies) 162s > 162s > foo <- outies[seq(1, niter) %% out$nspac == 0, ] 162s > foo <- array(as.vector(foo), dim = c(out$blen, out$nbatch, dim(foo)[2])) 162s > foo <- apply(foo, c(2, 3), mean) 162s > all.equal(foo, out$batch) 162s [1] TRUE 162s > 162s > 162s BEGIN TEST tests/zero-error.R 162s 162s R version 4.3.2 (2023-10-31) -- "Eye Holes" 162s Copyright (C) 2023 The R Foundation for Statistical Computing 162s Platform: aarch64-unknown-linux-gnu (64-bit) 162s 162s R is free software and comes with ABSOLUTELY NO WARRANTY. 162s You are welcome to redistribute it under certain conditions. 162s Type 'license()' or 'licence()' for distribution details. 162s 162s R is a collaborative project with many contributors. 162s Type 'contributors()' for more information and 162s 'citation()' on how to cite R or R packages in publications. 162s 162s Type 'demo()' for some demos, 'help()' for on-line help, or 162s 'help.start()' for an HTML browser interface to help. 162s Type 'q()' to quit R. 162s 162s > 162s > library(mcmc) 162s > 162s > # should give intelligible error (unlike before ver 0.9-8) 162s > 162s > suppressMessages(try(metrop(function(x) x, double(0), nbatch = 10))) 162s > 162s Error in system.time(out <- .Call(C_metrop, func1, initial, nbatch, blen, : 162s argument "initial" must have nonzero length 163s autopkgtest [19:15:12]: test generic: -----------------------] 164s generic PASS 164s autopkgtest [19:15:13]: test generic: - - - - - - - - - - results - - - - - - - - - - 164s autopkgtest [19:15:13]: test pkg-r-autopkgtest: preparing testbed 165s Reading package lists... 166s Building dependency tree... 166s Reading state information... 166s Starting pkgProblemResolver with broken count: 0 166s Starting 2 pkgProblemResolver with broken count: 0 166s Done 167s The following additional packages will be installed: 167s build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu cpp-aarch64-linux-gnu 167s dctrl-tools g++ g++-13 g++-13-aarch64-linux-gnu g++-aarch64-linux-gnu gcc 167s gcc-13 gcc-13-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-13 167s gfortran-13-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 167s libasan8 libatomic1 libblas-dev libbz2-dev libc-dev-bin libc6-dev libcc1-0 167s libcrypt-dev libgcc-13-dev libgfortran-13-dev libhwasan0 libicu-dev libisl23 167s libitm1 libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblsan0 167s liblzma-dev libmpc3 libncurses-dev libnsl-dev libpcre2-16-0 libpcre2-32-0 167s libpcre2-dev libpcre2-posix3 libpkgconf3 libpng-dev libreadline-dev 167s libstdc++-13-dev libtirpc-dev libtsan2 libubsan1 linux-libc-dev pkg-config 167s pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev rpcsvc-proto zlib1g-dev 167s Suggested packages: 167s cpp-doc gcc-13-locales cpp-13-doc debtags gcc-13-doc gcc-multilib 167s manpages-dev autoconf automake libtool flex bison gdb gcc-doc 167s gdb-aarch64-linux-gnu gfortran-doc gfortran-13-doc libcoarrays-dev 167s liblapack-doc glibc-doc icu-doc liblzma-doc ncurses-doc readline-doc 167s libstdc++-13-doc texlive-base texlive-latex-base texlive-plain-generic 167s texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils 167s texlive-latex-recommended texlive-latex-extra texinfo 167s Recommended packages: 167s bzip2-doc manpages manpages-dev libc-devtools libpng-tools 167s The following NEW packages will be installed: 167s autopkgtest-satdep build-essential cpp cpp-13 cpp-13-aarch64-linux-gnu 167s cpp-aarch64-linux-gnu dctrl-tools g++ g++-13 g++-13-aarch64-linux-gnu 167s g++-aarch64-linux-gnu gcc gcc-13 gcc-13-aarch64-linux-gnu 167s gcc-aarch64-linux-gnu gfortran gfortran-13 gfortran-13-aarch64-linux-gnu 167s gfortran-aarch64-linux-gnu icu-devtools libasan8 libatomic1 libblas-dev 167s libbz2-dev libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libgcc-13-dev 167s libgfortran-13-dev libhwasan0 libicu-dev libisl23 libitm1 libjpeg-dev 167s libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblsan0 liblzma-dev libmpc3 167s libncurses-dev libnsl-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev 167s libpcre2-posix3 libpkgconf3 libpng-dev libreadline-dev libstdc++-13-dev 167s libtirpc-dev libtsan2 libubsan1 linux-libc-dev pkg-config pkg-r-autopkgtest 167s pkgconf pkgconf-bin r-base-dev rpcsvc-proto zlib1g-dev 167s 0 upgraded, 62 newly installed, 0 to remove and 0 not upgraded. 167s Need to get 92.9 MB/92.9 MB of archives. 167s After this operation, 343 MB of additional disk space will be used. 167s Get:1 /tmp/autopkgtest.SrO9t6/2-autopkgtest-satdep.deb autopkgtest-satdep arm64 0 [732 B] 167s Get:2 http://ftpmaster.internal/ubuntu noble/main arm64 libc-dev-bin arm64 2.39-0ubuntu2 [19.7 kB] 167s Get:3 http://ftpmaster.internal/ubuntu noble/main arm64 linux-libc-dev arm64 6.8.0-11.11 [1569 kB] 168s Get:4 http://ftpmaster.internal/ubuntu noble/main arm64 libcrypt-dev arm64 1:4.4.36-4 [136 kB] 168s Get:5 http://ftpmaster.internal/ubuntu noble/main arm64 libtirpc-dev arm64 1.3.4+ds-1build1 [232 kB] 168s Get:6 http://ftpmaster.internal/ubuntu noble/main arm64 libnsl-dev arm64 1.3.0-3 [71.9 kB] 168s Get:7 http://ftpmaster.internal/ubuntu noble/main arm64 rpcsvc-proto arm64 1.4.2-0ubuntu6 [65.4 kB] 168s Get:8 http://ftpmaster.internal/ubuntu noble/main arm64 libc6-dev arm64 2.39-0ubuntu2 [1596 kB] 168s Get:9 http://ftpmaster.internal/ubuntu noble/main arm64 libisl23 arm64 0.26-3 [713 kB] 168s Get:10 http://ftpmaster.internal/ubuntu noble/main arm64 libmpc3 arm64 1.3.1-1 [55.3 kB] 168s Get:11 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [10.3 MB] 168s Get:12 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-13 arm64 13.2.0-17ubuntu2 [1028 B] 168s Get:13 http://ftpmaster.internal/ubuntu noble/main arm64 cpp-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [5316 B] 168s Get:14 http://ftpmaster.internal/ubuntu noble/main arm64 cpp arm64 4:13.2.0-7ubuntu1 [22.4 kB] 168s Get:15 http://ftpmaster.internal/ubuntu noble/main arm64 libcc1-0 arm64 14-20240303-1ubuntu1 [44.7 kB] 168s Get:16 http://ftpmaster.internal/ubuntu noble/main arm64 libitm1 arm64 14-20240303-1ubuntu1 [27.7 kB] 168s Get:17 http://ftpmaster.internal/ubuntu noble/main arm64 libatomic1 arm64 14-20240303-1ubuntu1 [11.4 kB] 168s Get:18 http://ftpmaster.internal/ubuntu noble/main arm64 libasan8 arm64 14-20240303-1ubuntu1 [2919 kB] 168s Get:19 http://ftpmaster.internal/ubuntu noble/main arm64 liblsan0 arm64 14-20240303-1ubuntu1 [1282 kB] 168s Get:20 http://ftpmaster.internal/ubuntu noble/main arm64 libtsan2 arm64 14-20240303-1ubuntu1 [2687 kB] 168s Get:21 http://ftpmaster.internal/ubuntu noble/main arm64 libubsan1 arm64 14-20240303-1ubuntu1 [1151 kB] 168s Get:22 http://ftpmaster.internal/ubuntu noble/main arm64 libhwasan0 arm64 14-20240303-1ubuntu1 [1597 kB] 168s Get:23 http://ftpmaster.internal/ubuntu noble/main arm64 libgcc-13-dev arm64 13.2.0-17ubuntu2 [2464 kB] 168s Get:24 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [20.1 MB] 169s Get:25 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-13 arm64 13.2.0-17ubuntu2 [467 kB] 169s Get:26 http://ftpmaster.internal/ubuntu noble/main arm64 gcc-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1198 B] 169s Get:27 http://ftpmaster.internal/ubuntu noble/main arm64 gcc arm64 4:13.2.0-7ubuntu1 [5018 B] 169s Get:28 http://ftpmaster.internal/ubuntu noble/main arm64 libstdc++-13-dev arm64 13.2.0-17ubuntu2 [2322 kB] 169s Get:29 http://ftpmaster.internal/ubuntu noble/main arm64 g++-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [11.7 MB] 169s Get:30 http://ftpmaster.internal/ubuntu noble/main arm64 g++-13 arm64 13.2.0-17ubuntu2 [14.4 kB] 169s Get:31 http://ftpmaster.internal/ubuntu noble/main arm64 g++-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [962 B] 169s Get:32 http://ftpmaster.internal/ubuntu noble/main arm64 g++ arm64 4:13.2.0-7ubuntu1 [1082 B] 169s Get:33 http://ftpmaster.internal/ubuntu noble/main arm64 build-essential arm64 12.10ubuntu1 [4932 B] 169s Get:34 http://ftpmaster.internal/ubuntu noble/main arm64 dctrl-tools arm64 2.24-3build2 [65.2 kB] 169s Get:35 http://ftpmaster.internal/ubuntu noble/main arm64 libgfortran-13-dev arm64 13.2.0-17ubuntu2 [478 kB] 169s Get:36 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-13-aarch64-linux-gnu arm64 13.2.0-17ubuntu2 [10.8 MB] 169s Get:37 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-13 arm64 13.2.0-17ubuntu2 [10.3 kB] 169s Get:38 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran-aarch64-linux-gnu arm64 4:13.2.0-7ubuntu1 [1022 B] 169s Get:39 http://ftpmaster.internal/ubuntu noble/main arm64 gfortran arm64 4:13.2.0-7ubuntu1 [1164 B] 169s Get:40 http://ftpmaster.internal/ubuntu noble/main arm64 icu-devtools arm64 74.2-1ubuntu1 [209 kB] 169s Get:41 http://ftpmaster.internal/ubuntu noble/main arm64 libblas-dev arm64 3.12.0-3 [111 kB] 169s Get:42 http://ftpmaster.internal/ubuntu noble/main arm64 libbz2-dev arm64 1.0.8-5ubuntu1 [35.8 kB] 169s Get:43 http://ftpmaster.internal/ubuntu noble/main arm64 libicu-dev arm64 74.2-1ubuntu1 [11.9 MB] 170s Get:44 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-turbo8-dev arm64 2.1.5-2ubuntu1 [304 kB] 170s Get:45 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg8-dev arm64 8c-2ubuntu11 [1484 B] 170s Get:46 http://ftpmaster.internal/ubuntu noble/main arm64 libjpeg-dev arm64 8c-2ubuntu11 [1482 B] 170s Get:47 http://ftpmaster.internal/ubuntu noble/main arm64 liblapack-dev arm64 3.12.0-3 [4293 kB] 170s Get:48 http://ftpmaster.internal/ubuntu noble/main arm64 libncurses-dev arm64 6.4+20240113-1ubuntu1 [385 kB] 170s Get:49 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-16-0 arm64 10.42-4ubuntu1 [195 kB] 170s Get:50 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-32-0 arm64 10.42-4ubuntu1 [183 kB] 170s Get:51 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-posix3 arm64 10.42-4ubuntu1 [6654 B] 170s Get:52 http://ftpmaster.internal/ubuntu noble/main arm64 libpcre2-dev arm64 10.42-4ubuntu1 [679 kB] 170s Get:53 http://ftpmaster.internal/ubuntu noble/main arm64 libpkgconf3 arm64 1.8.1-2 [31.2 kB] 170s Get:54 http://ftpmaster.internal/ubuntu noble/main arm64 zlib1g-dev arm64 1:1.3.dfsg-3ubuntu1 [895 kB] 170s Get:55 http://ftpmaster.internal/ubuntu noble/main arm64 libpng-dev arm64 1.6.43-1 [266 kB] 170s Get:56 http://ftpmaster.internal/ubuntu noble/main arm64 libreadline-dev arm64 8.2-3 [177 kB] 170s Get:57 http://ftpmaster.internal/ubuntu noble/main arm64 pkgconf-bin arm64 1.8.1-2 [20.4 kB] 170s Get:58 http://ftpmaster.internal/ubuntu noble/main arm64 pkgconf arm64 1.8.1-2 [16.7 kB] 170s Get:59 http://ftpmaster.internal/ubuntu noble/main arm64 pkg-config arm64 1.8.1-2 [7170 B] 170s Get:60 http://ftpmaster.internal/ubuntu noble/main arm64 liblzma-dev arm64 5.4.5-0.3 [209 kB] 170s Get:61 http://ftpmaster.internal/ubuntu noble/universe arm64 r-base-dev all 4.3.2-1build1 [4336 B] 170s Get:62 http://ftpmaster.internal/ubuntu noble/universe arm64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 171s Fetched 92.9 MB in 3s (32.0 MB/s) 171s Selecting previously unselected package libc-dev-bin. 171s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 76473 files and directories currently installed.) 171s Preparing to unpack .../00-libc-dev-bin_2.39-0ubuntu2_arm64.deb ... 171s Unpacking libc-dev-bin (2.39-0ubuntu2) ... 171s Selecting previously unselected package linux-libc-dev:arm64. 171s Preparing to unpack .../01-linux-libc-dev_6.8.0-11.11_arm64.deb ... 171s Unpacking linux-libc-dev:arm64 (6.8.0-11.11) ... 171s Selecting previously unselected package libcrypt-dev:arm64. 171s Preparing to unpack .../02-libcrypt-dev_1%3a4.4.36-4_arm64.deb ... 171s Unpacking libcrypt-dev:arm64 (1:4.4.36-4) ... 171s Selecting previously unselected package libtirpc-dev:arm64. 171s Preparing to unpack .../03-libtirpc-dev_1.3.4+ds-1build1_arm64.deb ... 171s Unpacking libtirpc-dev:arm64 (1.3.4+ds-1build1) ... 171s Selecting previously unselected package libnsl-dev:arm64. 171s Preparing to unpack .../04-libnsl-dev_1.3.0-3_arm64.deb ... 171s Unpacking libnsl-dev:arm64 (1.3.0-3) ... 171s Selecting previously unselected package rpcsvc-proto. 171s Preparing to unpack .../05-rpcsvc-proto_1.4.2-0ubuntu6_arm64.deb ... 171s Unpacking rpcsvc-proto (1.4.2-0ubuntu6) ... 171s Selecting previously unselected package libc6-dev:arm64. 171s Preparing to unpack .../06-libc6-dev_2.39-0ubuntu2_arm64.deb ... 171s Unpacking libc6-dev:arm64 (2.39-0ubuntu2) ... 171s Selecting previously unselected package libisl23:arm64. 171s Preparing to unpack .../07-libisl23_0.26-3_arm64.deb ... 171s Unpacking libisl23:arm64 (0.26-3) ... 171s Selecting previously unselected package libmpc3:arm64. 171s Preparing to unpack .../08-libmpc3_1.3.1-1_arm64.deb ... 171s Unpacking libmpc3:arm64 (1.3.1-1) ... 171s Selecting previously unselected package cpp-13-aarch64-linux-gnu. 171s Preparing to unpack .../09-cpp-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 171s Unpacking cpp-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 171s Selecting previously unselected package cpp-13. 171s Preparing to unpack .../10-cpp-13_13.2.0-17ubuntu2_arm64.deb ... 171s Unpacking cpp-13 (13.2.0-17ubuntu2) ... 171s Selecting previously unselected package cpp-aarch64-linux-gnu. 171s Preparing to unpack .../11-cpp-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 171s Unpacking cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 171s Selecting previously unselected package cpp. 171s Preparing to unpack .../12-cpp_4%3a13.2.0-7ubuntu1_arm64.deb ... 171s Unpacking cpp (4:13.2.0-7ubuntu1) ... 172s Selecting previously unselected package libcc1-0:arm64. 172s Preparing to unpack .../13-libcc1-0_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libcc1-0:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libitm1:arm64. 172s Preparing to unpack .../14-libitm1_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libitm1:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libatomic1:arm64. 172s Preparing to unpack .../15-libatomic1_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libatomic1:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libasan8:arm64. 172s Preparing to unpack .../16-libasan8_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libasan8:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package liblsan0:arm64. 172s Preparing to unpack .../17-liblsan0_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking liblsan0:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libtsan2:arm64. 172s Preparing to unpack .../18-libtsan2_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libtsan2:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libubsan1:arm64. 172s Preparing to unpack .../19-libubsan1_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libubsan1:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libhwasan0:arm64. 172s Preparing to unpack .../20-libhwasan0_14-20240303-1ubuntu1_arm64.deb ... 172s Unpacking libhwasan0:arm64 (14-20240303-1ubuntu1) ... 172s Selecting previously unselected package libgcc-13-dev:arm64. 172s Preparing to unpack .../21-libgcc-13-dev_13.2.0-17ubuntu2_arm64.deb ... 172s Unpacking libgcc-13-dev:arm64 (13.2.0-17ubuntu2) ... 172s Selecting previously unselected package gcc-13-aarch64-linux-gnu. 172s Preparing to unpack .../22-gcc-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 172s Unpacking gcc-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package gcc-13. 173s Preparing to unpack .../23-gcc-13_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking gcc-13 (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package gcc-aarch64-linux-gnu. 173s Preparing to unpack .../24-gcc-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 173s Unpacking gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 173s Selecting previously unselected package gcc. 173s Preparing to unpack .../25-gcc_4%3a13.2.0-7ubuntu1_arm64.deb ... 173s Unpacking gcc (4:13.2.0-7ubuntu1) ... 173s Selecting previously unselected package libstdc++-13-dev:arm64. 173s Preparing to unpack .../26-libstdc++-13-dev_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking libstdc++-13-dev:arm64 (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package g++-13-aarch64-linux-gnu. 173s Preparing to unpack .../27-g++-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking g++-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package g++-13. 173s Preparing to unpack .../28-g++-13_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking g++-13 (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package g++-aarch64-linux-gnu. 173s Preparing to unpack .../29-g++-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 173s Unpacking g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 173s Selecting previously unselected package g++. 173s Preparing to unpack .../30-g++_4%3a13.2.0-7ubuntu1_arm64.deb ... 173s Unpacking g++ (4:13.2.0-7ubuntu1) ... 173s Selecting previously unselected package build-essential. 173s Preparing to unpack .../31-build-essential_12.10ubuntu1_arm64.deb ... 173s Unpacking build-essential (12.10ubuntu1) ... 173s Selecting previously unselected package dctrl-tools. 173s Preparing to unpack .../32-dctrl-tools_2.24-3build2_arm64.deb ... 173s Unpacking dctrl-tools (2.24-3build2) ... 173s Selecting previously unselected package libgfortran-13-dev:arm64. 173s Preparing to unpack .../33-libgfortran-13-dev_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking libgfortran-13-dev:arm64 (13.2.0-17ubuntu2) ... 173s Selecting previously unselected package gfortran-13-aarch64-linux-gnu. 173s Preparing to unpack .../34-gfortran-13-aarch64-linux-gnu_13.2.0-17ubuntu2_arm64.deb ... 173s Unpacking gfortran-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 174s Selecting previously unselected package gfortran-13. 174s Preparing to unpack .../35-gfortran-13_13.2.0-17ubuntu2_arm64.deb ... 174s Unpacking gfortran-13 (13.2.0-17ubuntu2) ... 174s Selecting previously unselected package gfortran-aarch64-linux-gnu. 174s Preparing to unpack .../36-gfortran-aarch64-linux-gnu_4%3a13.2.0-7ubuntu1_arm64.deb ... 174s Unpacking gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 174s Selecting previously unselected package gfortran. 174s Preparing to unpack .../37-gfortran_4%3a13.2.0-7ubuntu1_arm64.deb ... 174s Unpacking gfortran (4:13.2.0-7ubuntu1) ... 174s Selecting previously unselected package icu-devtools. 174s Preparing to unpack .../38-icu-devtools_74.2-1ubuntu1_arm64.deb ... 174s Unpacking icu-devtools (74.2-1ubuntu1) ... 174s Selecting previously unselected package libblas-dev:arm64. 174s Preparing to unpack .../39-libblas-dev_3.12.0-3_arm64.deb ... 174s Unpacking libblas-dev:arm64 (3.12.0-3) ... 174s Selecting previously unselected package libbz2-dev:arm64. 174s Preparing to unpack .../40-libbz2-dev_1.0.8-5ubuntu1_arm64.deb ... 174s Unpacking libbz2-dev:arm64 (1.0.8-5ubuntu1) ... 174s Selecting previously unselected package libicu-dev:arm64. 174s Preparing to unpack .../41-libicu-dev_74.2-1ubuntu1_arm64.deb ... 174s Unpacking libicu-dev:arm64 (74.2-1ubuntu1) ... 174s Selecting previously unselected package libjpeg-turbo8-dev:arm64. 174s Preparing to unpack .../42-libjpeg-turbo8-dev_2.1.5-2ubuntu1_arm64.deb ... 174s Unpacking libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu1) ... 174s Selecting previously unselected package libjpeg8-dev:arm64. 174s Preparing to unpack .../43-libjpeg8-dev_8c-2ubuntu11_arm64.deb ... 174s Unpacking libjpeg8-dev:arm64 (8c-2ubuntu11) ... 174s Selecting previously unselected package libjpeg-dev:arm64. 174s Preparing to unpack .../44-libjpeg-dev_8c-2ubuntu11_arm64.deb ... 174s Unpacking libjpeg-dev:arm64 (8c-2ubuntu11) ... 174s Selecting previously unselected package liblapack-dev:arm64. 174s Preparing to unpack .../45-liblapack-dev_3.12.0-3_arm64.deb ... 174s Unpacking liblapack-dev:arm64 (3.12.0-3) ... 174s Selecting previously unselected package libncurses-dev:arm64. 174s Preparing to unpack .../46-libncurses-dev_6.4+20240113-1ubuntu1_arm64.deb ... 174s Unpacking libncurses-dev:arm64 (6.4+20240113-1ubuntu1) ... 174s Selecting previously unselected package libpcre2-16-0:arm64. 174s Preparing to unpack .../47-libpcre2-16-0_10.42-4ubuntu1_arm64.deb ... 174s Unpacking libpcre2-16-0:arm64 (10.42-4ubuntu1) ... 174s Selecting previously unselected package libpcre2-32-0:arm64. 174s Preparing to unpack .../48-libpcre2-32-0_10.42-4ubuntu1_arm64.deb ... 174s Unpacking libpcre2-32-0:arm64 (10.42-4ubuntu1) ... 174s Selecting previously unselected package libpcre2-posix3:arm64. 174s Preparing to unpack .../49-libpcre2-posix3_10.42-4ubuntu1_arm64.deb ... 174s Unpacking libpcre2-posix3:arm64 (10.42-4ubuntu1) ... 175s Selecting previously unselected package libpcre2-dev:arm64. 175s Preparing to unpack .../50-libpcre2-dev_10.42-4ubuntu1_arm64.deb ... 175s Unpacking libpcre2-dev:arm64 (10.42-4ubuntu1) ... 175s Selecting previously unselected package libpkgconf3:arm64. 175s Preparing to unpack .../51-libpkgconf3_1.8.1-2_arm64.deb ... 175s Unpacking libpkgconf3:arm64 (1.8.1-2) ... 175s Selecting previously unselected package zlib1g-dev:arm64. 175s Preparing to unpack .../52-zlib1g-dev_1%3a1.3.dfsg-3ubuntu1_arm64.deb ... 175s Unpacking zlib1g-dev:arm64 (1:1.3.dfsg-3ubuntu1) ... 175s Selecting previously unselected package libpng-dev:arm64. 175s Preparing to unpack .../53-libpng-dev_1.6.43-1_arm64.deb ... 175s Unpacking libpng-dev:arm64 (1.6.43-1) ... 175s Selecting previously unselected package libreadline-dev:arm64. 175s Preparing to unpack .../54-libreadline-dev_8.2-3_arm64.deb ... 175s Unpacking libreadline-dev:arm64 (8.2-3) ... 175s Selecting previously unselected package pkgconf-bin. 175s Preparing to unpack .../55-pkgconf-bin_1.8.1-2_arm64.deb ... 175s Unpacking pkgconf-bin (1.8.1-2) ... 175s Selecting previously unselected package pkgconf:arm64. 175s Preparing to unpack .../56-pkgconf_1.8.1-2_arm64.deb ... 175s Unpacking pkgconf:arm64 (1.8.1-2) ... 175s Selecting previously unselected package pkg-config:arm64. 175s Preparing to unpack .../57-pkg-config_1.8.1-2_arm64.deb ... 175s Unpacking pkg-config:arm64 (1.8.1-2) ... 175s Selecting previously unselected package liblzma-dev:arm64. 175s Preparing to unpack .../58-liblzma-dev_5.4.5-0.3_arm64.deb ... 175s Unpacking liblzma-dev:arm64 (5.4.5-0.3) ... 175s Selecting previously unselected package r-base-dev. 175s Preparing to unpack .../59-r-base-dev_4.3.2-1build1_all.deb ... 175s Unpacking r-base-dev (4.3.2-1build1) ... 175s Selecting previously unselected package pkg-r-autopkgtest. 175s Preparing to unpack .../60-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 175s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 175s Selecting previously unselected package autopkgtest-satdep. 175s Preparing to unpack .../61-2-autopkgtest-satdep.deb ... 175s Unpacking autopkgtest-satdep (0) ... 175s Setting up linux-libc-dev:arm64 (6.8.0-11.11) ... 175s Setting up libpcre2-16-0:arm64 (10.42-4ubuntu1) ... 175s Setting up libpcre2-32-0:arm64 (10.42-4ubuntu1) ... 175s Setting up libtirpc-dev:arm64 (1.3.4+ds-1build1) ... 175s Setting up libpkgconf3:arm64 (1.8.1-2) ... 175s Setting up rpcsvc-proto (1.4.2-0ubuntu6) ... 175s Setting up libmpc3:arm64 (1.3.1-1) ... 175s Setting up libatomic1:arm64 (14-20240303-1ubuntu1) ... 175s Setting up icu-devtools (74.2-1ubuntu1) ... 175s Setting up pkgconf-bin (1.8.1-2) ... 175s Setting up liblzma-dev:arm64 (5.4.5-0.3) ... 175s Setting up libubsan1:arm64 (14-20240303-1ubuntu1) ... 175s Setting up libpcre2-posix3:arm64 (10.42-4ubuntu1) ... 175s Setting up libnsl-dev:arm64 (1.3.0-3) ... 175s Setting up libhwasan0:arm64 (14-20240303-1ubuntu1) ... 175s Setting up libcrypt-dev:arm64 (1:4.4.36-4) ... 175s Setting up libasan8:arm64 (14-20240303-1ubuntu1) ... 175s Setting up libtsan2:arm64 (14-20240303-1ubuntu1) ... 175s Setting up libisl23:arm64 (0.26-3) ... 175s Setting up libc-dev-bin (2.39-0ubuntu2) ... 175s Setting up libcc1-0:arm64 (14-20240303-1ubuntu1) ... 175s Setting up liblsan0:arm64 (14-20240303-1ubuntu1) ... 175s Setting up libblas-dev:arm64 (3.12.0-3) ... 175s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so to provide /usr/lib/aarch64-linux-gnu/libblas.so (libblas.so-aarch64-linux-gnu) in auto mode 175s Setting up dctrl-tools (2.24-3build2) ... 175s Setting up libitm1:arm64 (14-20240303-1ubuntu1) ... 175s Setting up cpp-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 175s Setting up pkgconf:arm64 (1.8.1-2) ... 175s Setting up cpp-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 175s Setting up liblapack-dev:arm64 (3.12.0-3) ... 175s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so to provide /usr/lib/aarch64-linux-gnu/liblapack.so (liblapack.so-aarch64-linux-gnu) in auto mode 175s Setting up pkg-config:arm64 (1.8.1-2) ... 175s Setting up libgcc-13-dev:arm64 (13.2.0-17ubuntu2) ... 175s Setting up libc6-dev:arm64 (2.39-0ubuntu2) ... 175s Setting up libgfortran-13-dev:arm64 (13.2.0-17ubuntu2) ... 175s Setting up libicu-dev:arm64 (74.2-1ubuntu1) ... 175s Setting up libstdc++-13-dev:arm64 (13.2.0-17ubuntu2) ... 175s Setting up libbz2-dev:arm64 (1.0.8-5ubuntu1) ... 175s Setting up libjpeg-turbo8-dev:arm64 (2.1.5-2ubuntu1) ... 175s Setting up libncurses-dev:arm64 (6.4+20240113-1ubuntu1) ... 175s Setting up libpcre2-dev:arm64 (10.42-4ubuntu1) ... 175s Setting up cpp-13 (13.2.0-17ubuntu2) ... 175s Setting up gcc-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 175s Setting up libreadline-dev:arm64 (8.2-3) ... 175s Setting up gcc-13 (13.2.0-17ubuntu2) ... 175s Setting up zlib1g-dev:arm64 (1:1.3.dfsg-3ubuntu1) ... 175s Setting up cpp (4:13.2.0-7ubuntu1) ... 175s Setting up libjpeg8-dev:arm64 (8c-2ubuntu11) ... 175s Setting up g++-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 175s Setting up gcc-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 175s Setting up g++-13 (13.2.0-17ubuntu2) ... 175s Setting up libpng-dev:arm64 (1.6.43-1) ... 175s Setting up libjpeg-dev:arm64 (8c-2ubuntu11) ... 175s Setting up gfortran-13-aarch64-linux-gnu (13.2.0-17ubuntu2) ... 175s Setting up gcc (4:13.2.0-7ubuntu1) ... 175s Setting up gfortran-13 (13.2.0-17ubuntu2) ... 175s Setting up g++-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 175s Setting up gfortran-aarch64-linux-gnu (4:13.2.0-7ubuntu1) ... 175s Setting up gfortran (4:13.2.0-7ubuntu1) ... 175s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 175s update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist 175s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 175s update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist 175s Setting up g++ (4:13.2.0-7ubuntu1) ... 175s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 175s Setting up build-essential (12.10ubuntu1) ... 175s Setting up r-base-dev (4.3.2-1build1) ... 175s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 175s Setting up autopkgtest-satdep (0) ... 175s Processing triggers for man-db (2.12.0-3) ... 176s Processing triggers for install-info (7.1-3) ... 176s Processing triggers for libc-bin (2.39-0ubuntu2) ... 179s (Reading database ... 80032 files and directories currently installed.) 179s Removing autopkgtest-satdep (0) ... 179s autopkgtest [19:15:28]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 179s autopkgtest [19:15:28]: test pkg-r-autopkgtest: [----------------------- 180s Test: Try to load the R library mcmc 180s 180s R version 4.3.2 (2023-10-31) -- "Eye Holes" 180s Copyright (C) 2023 The R Foundation for Statistical Computing 180s Platform: aarch64-unknown-linux-gnu (64-bit) 180s 180s R is free software and comes with ABSOLUTELY NO WARRANTY. 180s You are welcome to redistribute it under certain conditions. 180s Type 'license()' or 'licence()' for distribution details. 180s 180s R is a collaborative project with many contributors. 180s Type 'contributors()' for more information and 180s 'citation()' on how to cite R or R packages in publications. 180s 180s Type 'demo()' for some demos, 'help()' for on-line help, or 180s 'help.start()' for an HTML browser interface to help. 180s Type 'q()' to quit R. 180s 180s > library('mcmc') 180s > 180s > 180s Other tests are currently unsupported! 180s They will be progressively added. 180s autopkgtest [19:15:29]: test pkg-r-autopkgtest: -----------------------] 181s pkg-r-autopkgtest PASS 181s autopkgtest [19:15:30]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 181s autopkgtest [19:15:30]: @@@@@@@@@@@@@@@@@@@@ summary 181s generic PASS 181s pkg-r-autopkgtest PASS 192s Creating nova instance adt-noble-arm64-r-cran-mcmc-20240316-191229-juju-7f2275-prod-proposed-migration-environment-3 from image adt/ubuntu-noble-arm64-server-20240314.img (UUID 7faf5f09-d335-4346-a441-4eab2f9c04fe)...