Diff of the two buildlogs: -- --- b1/build.log 2023-08-15 08:41:08.536374654 +0000 +++ b2/build.log 2023-08-15 08:52:00.718452672 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Aug 14 20:33:29 -12 2023 -I: pbuilder-time-stamp: 1692088409 +I: Current time: Tue Sep 17 05:04:11 +14 2024 +I: pbuilder-time-stamp: 1726499051 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bullseye-reproducible-base.tgz] I: copying local configuration @@ -18,8 +18,8 @@ I: copying [./octave-statistics_1.4.2-2.debian.tar.xz] I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' -gpgv: keyblock resource '/tmp/dpkg-verify-sig.8bSK6Azk/trustedkeys.kbx': General error -gpgv: Signature made Thu Jul 30 08:41:55 2020 -12 +gpgv: keyblock resource '/tmp/dpkg-verify-sig.uX8q886S/trustedkeys.kbx': General error +gpgv: Signature made Fri Jul 31 10:41:55 2020 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: Can't check signature: No public key dpkg-source: warning: failed to verify signature on ./octave-statistics_1.4.2-2.dsc @@ -32,137 +32,168 @@ dpkg-source: info: applying t_test-skip.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/5804/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/D01_modify_environment starting +debug: Running on ionos6-i386. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Sep 17 05:04 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=8 ' - DISTRIBUTION='bullseye' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="1" [2]="4" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.1.4(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all,-fixfilepath parallel=15 ' + DIRSTACK=() + DISTRIBUTION=bullseye + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='4c52d7f962744c8db22dddd4ed98588f' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='5804' - PS1='# ' - PS2='> ' + INVOCATION_ID=59f0eca1bff944c39ca053fdcf3efcc3 + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=79283 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.a0pZytGW/pbuilderrc_BG31 --distribution bullseye --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.a0pZytGW/b1 --logfile b1/build.log octave-statistics_1.4.2-2.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://78.137.99.97:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.a0pZytGW/pbuilderrc_eKpc --distribution bullseye --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bullseye-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.a0pZytGW/b2 --logfile b2/build.log octave-statistics_1.4.2-2.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://85.184.249.68:3128 I: uname -a - Linux ionos2-i386 6.1.0-11-686-pae #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) i686 GNU/Linux + Linux i-capture-the-hostname 6.1.0-11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux I: ls -l /bin total 5776 - -rwxr-xr-x 1 root root 1367848 Mar 27 2022 bash - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bunzip2 - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bzcat - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Jul 20 2020 bzdiff - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Sep 4 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Jul 20 2020 bzgrep - -rwxr-xr-x 3 root root 38280 Jul 20 2020 bzip2 - -rwxr-xr-x 1 root root 17768 Jul 20 2020 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 20 2020 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 20 2020 bzmore - -rwxr-xr-x 1 root root 38824 Sep 22 2020 cat - -rwxr-xr-x 1 root root 71624 Sep 22 2020 chgrp - -rwxr-xr-x 1 root root 67528 Sep 22 2020 chmod - -rwxr-xr-x 1 root root 75752 Sep 22 2020 chown - -rwxr-xr-x 1 root root 157960 Sep 22 2020 cp - -rwxr-xr-x 1 root root 128724 Dec 10 2020 dash - -rwxr-xr-x 1 root root 124904 Sep 22 2020 date - -rwxr-xr-x 1 root root 92172 Sep 22 2020 dd - -rwxr-xr-x 1 root root 100752 Sep 22 2020 df - -rwxr-xr-x 1 root root 153964 Sep 22 2020 dir - -rwxr-xr-x 1 root root 83644 Jan 20 2022 dmesg - lrwxrwxrwx 1 root root 8 Nov 6 2019 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Nov 6 2019 domainname -> hostname - -rwxr-xr-x 1 root root 34664 Sep 22 2020 echo - -rwxr-xr-x 1 root root 28 Jan 24 2023 egrep - -rwxr-xr-x 1 root root 34664 Sep 22 2020 false - -rwxr-xr-x 1 root root 28 Jan 24 2023 fgrep - -rwxr-xr-x 1 root root 71928 Jan 20 2022 findmnt - -rwsr-xr-x 1 root root 30112 Feb 26 2021 fusermount - -rwxr-xr-x 1 root root 210488 Jan 24 2023 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 100952 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 21916 Nov 6 2019 hostname - -rwxr-xr-x 1 root root 83980 Sep 22 2020 ln - -rwxr-xr-x 1 root root 55572 Feb 7 2020 login - -rwxr-xr-x 1 root root 153964 Sep 22 2020 ls - -rwxr-xr-x 1 root root 153124 Jan 20 2022 lsblk - -rwxr-xr-x 1 root root 96328 Sep 22 2020 mkdir - -rwxr-xr-x 1 root root 79912 Sep 22 2020 mknod - -rwxr-xr-x 1 root root 47048 Sep 22 2020 mktemp - -rwxr-xr-x 1 root root 58920 Jan 20 2022 more - -rwsr-xr-x 1 root root 50720 Jan 20 2022 mount - -rwxr-xr-x 1 root root 13856 Jan 20 2022 mountpoint - -rwxr-xr-x 1 root root 157996 Sep 22 2020 mv - lrwxrwxrwx 1 root root 8 Nov 6 2019 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Dec 16 2021 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 38824 Sep 22 2020 pwd - lrwxrwxrwx 1 root root 4 Mar 27 2022 rbash -> bash - -rwxr-xr-x 1 root root 46984 Sep 22 2020 readlink - -rwxr-xr-x 1 root root 75720 Sep 22 2020 rm - -rwxr-xr-x 1 root root 46984 Sep 22 2020 rmdir - -rwxr-xr-x 1 root root 22292 Sep 27 2020 run-parts - -rwxr-xr-x 1 root root 125036 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Aug 7 02:42 sh -> dash - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sleep - -rwxr-xr-x 1 root root 83880 Sep 22 2020 stty - -rwsr-xr-x 1 root root 79396 Jan 20 2022 su - -rwxr-xr-x 1 root root 34696 Sep 22 2020 sync - -rwxr-xr-x 1 root root 602584 Feb 16 2021 tar - -rwxr-xr-x 1 root root 13860 Sep 27 2020 tempfile - -rwxr-xr-x 1 root root 108520 Sep 22 2020 touch - -rwxr-xr-x 1 root root 34664 Sep 22 2020 true - -rwxr-xr-x 1 root root 17768 Feb 26 2021 ulockmgr_server - -rwsr-xr-x 1 root root 30236 Jan 20 2022 umount - -rwxr-xr-x 1 root root 34664 Sep 22 2020 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 153964 Sep 22 2020 vdir - -rwxr-xr-x 1 root root 63024 Jan 20 2022 wdctl - lrwxrwxrwx 1 root root 8 Nov 6 2019 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 5898 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8049 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/5804/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 1367848 Mar 28 2022 bash + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bunzip2 + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bzcat + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Jul 21 2020 bzdiff + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Sep 5 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Jul 21 2020 bzgrep + -rwxr-xr-x 3 root root 38280 Jul 21 2020 bzip2 + -rwxr-xr-x 1 root root 17768 Jul 21 2020 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 21 2020 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 21 2020 bzmore + -rwxr-xr-x 1 root root 38824 Sep 23 2020 cat + -rwxr-xr-x 1 root root 71624 Sep 23 2020 chgrp + -rwxr-xr-x 1 root root 67528 Sep 23 2020 chmod + -rwxr-xr-x 1 root root 75752 Sep 23 2020 chown + -rwxr-xr-x 1 root root 157960 Sep 23 2020 cp + -rwxr-xr-x 1 root root 128724 Dec 11 2020 dash + -rwxr-xr-x 1 root root 124904 Sep 23 2020 date + -rwxr-xr-x 1 root root 92172 Sep 23 2020 dd + -rwxr-xr-x 1 root root 100752 Sep 23 2020 df + -rwxr-xr-x 1 root root 153964 Sep 23 2020 dir + -rwxr-xr-x 1 root root 83644 Jan 21 2022 dmesg + lrwxrwxrwx 1 root root 8 Nov 8 2019 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Nov 8 2019 domainname -> hostname + -rwxr-xr-x 1 root root 34664 Sep 23 2020 echo + -rwxr-xr-x 1 root root 28 Jan 25 2023 egrep + -rwxr-xr-x 1 root root 34664 Sep 23 2020 false + -rwxr-xr-x 1 root root 28 Jan 25 2023 fgrep + -rwxr-xr-x 1 root root 71928 Jan 21 2022 findmnt + -rwsr-xr-x 1 root root 30112 Feb 27 2021 fusermount + -rwxr-xr-x 1 root root 210488 Jan 25 2023 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 100952 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 21916 Nov 8 2019 hostname + -rwxr-xr-x 1 root root 83980 Sep 23 2020 ln + -rwxr-xr-x 1 root root 55572 Feb 8 2020 login + -rwxr-xr-x 1 root root 153964 Sep 23 2020 ls + -rwxr-xr-x 1 root root 153124 Jan 21 2022 lsblk + -rwxr-xr-x 1 root root 96328 Sep 23 2020 mkdir + -rwxr-xr-x 1 root root 79912 Sep 23 2020 mknod + -rwxr-xr-x 1 root root 47048 Sep 23 2020 mktemp + -rwxr-xr-x 1 root root 58920 Jan 21 2022 more + -rwsr-xr-x 1 root root 50720 Jan 21 2022 mount + -rwxr-xr-x 1 root root 13856 Jan 21 2022 mountpoint + -rwxr-xr-x 1 root root 157996 Sep 23 2020 mv + lrwxrwxrwx 1 root root 8 Nov 8 2019 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Dec 17 2021 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 38824 Sep 23 2020 pwd + lrwxrwxrwx 1 root root 4 Mar 28 2022 rbash -> bash + -rwxr-xr-x 1 root root 46984 Sep 23 2020 readlink + -rwxr-xr-x 1 root root 75720 Sep 23 2020 rm + -rwxr-xr-x 1 root root 46984 Sep 23 2020 rmdir + -rwxr-xr-x 1 root root 22292 Sep 28 2020 run-parts + -rwxr-xr-x 1 root root 125036 Dec 23 2018 sed + lrwxrwxrwx 1 root root 9 Sep 17 05:04 sh -> /bin/bash + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sleep + -rwxr-xr-x 1 root root 83880 Sep 23 2020 stty + -rwsr-xr-x 1 root root 79396 Jan 21 2022 su + -rwxr-xr-x 1 root root 34696 Sep 23 2020 sync + -rwxr-xr-x 1 root root 602584 Feb 17 2021 tar + -rwxr-xr-x 1 root root 13860 Sep 28 2020 tempfile + -rwxr-xr-x 1 root root 108520 Sep 23 2020 touch + -rwxr-xr-x 1 root root 34664 Sep 23 2020 true + -rwxr-xr-x 1 root root 17768 Feb 27 2021 ulockmgr_server + -rwsr-xr-x 1 root root 30236 Jan 21 2022 umount + -rwxr-xr-x 1 root root 34664 Sep 23 2020 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 153964 Sep 23 2020 vdir + -rwxr-xr-x 1 root root 63024 Jan 21 2022 wdctl + lrwxrwxrwx 1 root root 8 Nov 8 2019 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 5898 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8049 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -651,7 +682,7 @@ Get: 444 http://deb.debian.org/debian bullseye/main i386 dh-octave-autopkgtest all 1.0.3 [9376 B] Get: 445 http://deb.debian.org/debian bullseye/main i386 dh-octave all 1.0.3 [21.9 kB] Get: 446 http://deb.debian.org/debian bullseye/main i386 octave-io i386 2.6.3-1+b1 [205 kB] -Fetched 163 MB in 45s (3622 kB/s) +Fetched 163 MB in 4s (42.5 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package bsdextrautils. (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 ... 19727 files and directories currently installed.) @@ -2482,7 +2513,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/octave-statistics-1.4.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-statistics_1.4.2-2_source.changes +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for bullseye +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/octave-statistics-1.4.2/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-statistics_1.4.2-2_source.changes dpkg-buildpackage: info: source package octave-statistics dpkg-buildpackage: info: source version 1.4.2-2 dpkg-buildpackage: info: source distribution unstable @@ -2518,9 +2553,9 @@ pkg at line 568 column 9 /usr/share/dh-octave/install-pkg.m at line 43 column 1 -checking build system type... i686-pc-linux-gnu -checking host system type... i686-pc-linux-gnu -checking target system type... i686-pc-linux-gnu +checking build system type... x86_64-pc-linux-gnu +checking host system type... x86_64-pc-linux-gnu +checking target system type... x86_64-pc-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out @@ -2562,418 +2597,209 @@ dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... -[inst/raylcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/raylcdf.m +[inst/unidstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/unidstat.m ***** test - x = 0:0.5:2.5; - sigma = 1:6; - p = raylcdf (x, sigma); - expected_p = [0.0000, 0.0308, 0.0540, 0.0679, 0.0769, 0.0831]; - assert (p, expected_p, 0.001); + n = 1:6; + [m, v] = unidstat (n); + expected_m = [1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000]; + expected_v = [0.0000, 0.2500, 0.6667, 1.2500, 2.0000, 2.9167]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/burrrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/burrrnd.m +***** assert (size (burrrnd (1, 1, 1)), [1 1]) +***** assert (size (burrrnd (ones (2,1), 1, 1)), [2, 1]) +***** assert (size (burrrnd (ones (2,2), 1, 1)), [2, 2]) +***** assert (size (burrrnd (1, ones (2,1), 1)), [2, 1]) +***** assert (size (burrrnd (1, ones (2,2), 1)), [2, 2]) +***** assert (size (burrrnd (1, 1, ones (2,1))), [2, 1]) +***** assert (size (burrrnd (1, 1, ones (2,2))), [2, 2]) +***** assert (size (burrrnd (1, 1, 1, 3)), [3, 3]) +***** assert (size (burrrnd (1, 1, 1, [4 1])), [4, 1]) +***** assert (size (burrrnd (1, 1, 1, 4, 1)), [4, 1]) +***** assert (class (burrrnd (1,1,1)), "double") +***** assert (class (burrrnd (single (1),1,1)), "single") +***** assert (class (burrrnd (single ([1 1]),1,1)), "single") +***** assert (class (burrrnd (1,single (1),1)), "single") +***** assert (class (burrrnd (1,single ([1 1]),1)), "single") +***** assert (class (burrrnd (1,1,single (1))), "single") +***** assert (class (burrrnd (1,1,single ([1 1]))), "single") +***** error burrrnd () +***** error burrrnd (1) +***** error burrrnd (1,2) +***** error burrrnd (ones (3), ones (2), ones (2), 2) +***** error burrrnd (ones (2), ones (3), ones (2), 2) +***** error burrrnd (ones (2), ones (2), ones (3), 2) +***** error burrrnd (i, 2, 2) +***** error burrrnd (2, i, 2) +***** error burrrnd (2, 2, i) +***** error burrrnd (4,2,2, -1) +***** error burrrnd (4,2,2, ones (2)) +***** error burrrnd (4,2,2, [2 -1 2]) +***** error burrrnd (4*ones (2),2,2, 3) +***** error burrrnd (4*ones (2),2,2, [3, 2]) +***** error burrrnd (4*ones (2),2,2, 3, 2) +32 tests, 32 passed, 0 known failure, 0 skipped +[inst/ttest.m] +>>>>> /build/octave-statistics-1.4.2/inst/ttest.m ***** test - x = 0:0.5:2.5; - p = raylcdf (x, 0.5); - expected_p = [0.0000, 0.3935, 0.8647, 0.9889, 0.9997, 1.0000]; - assert (p, expected_p, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/wishrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/wishrnd.m -***** assert(size (wishrnd (1,2)), [1, 1]); -***** assert(size (wishrnd (1,2,[])), [1, 1]); -***** assert(size (wishrnd (1,2,1)), [1, 1]); -***** assert(size (wishrnd ([],2,1)), [1, 1]); -***** assert(size (wishrnd ([3 1; 1 3], 2.00001, [], 1)), [2, 2]); -***** assert(size (wishrnd (eye(2), 2, [], 3)), [2, 2, 3]); -***** error wishrnd () -***** error wishrnd (1) -***** error wishrnd ([1; 1], 2) -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/gpcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/gpcdf.m -***** shared x,y1,y2,y3 - x = [-Inf, -1, 0, 1/2, 1, Inf]; - y1 = [0, 0, 0, 0.3934693402873666, 0.6321205588285577, 1]; - y2 = [0, 0, 0, 1/3, 1/2, 1]; - y3 = [0, 0, 0, 1/2, 1, 1]; - seps = eps('single')*5; -***** assert (gpcdf (x, zeros (1,6), ones (1,6), zeros (1,6)), y1, eps) -***** assert (gpcdf (x, 0, 1, zeros (1,6)), y1, eps) -***** assert (gpcdf (x, 0, ones (1,6), 0), y1, eps) -***** assert (gpcdf (x, zeros (1,6), 1, 0), y1, eps) -***** assert (gpcdf (x, 0, 1, 0), y1, eps) -***** assert (gpcdf (x, 0, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y1(5:6)], eps) -***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y1(5:6)], eps) -***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 0), [y1(1:3), NaN, y1(5:6)], eps) -***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, 0), [y1(1:3), NaN, y1(5:6)], eps) -***** assert (gpcdf (x, ones (1,6), ones (1,6), zeros (1,6)), y2, eps) -***** assert (gpcdf (x, 1, 1, zeros (1,6)), y2, eps) -***** assert (gpcdf (x, 1, ones (1,6), 0), y2, eps) -***** assert (gpcdf (x, ones (1,6), 1, 0), y2, eps) -***** assert (gpcdf (x, 1, 1, 0), y2, eps) -***** assert (gpcdf (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 1, 1, 0), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, -ones (1,6), ones (1,6), zeros (1,6)), y3, eps) -***** assert (gpcdf (x, -1, 1, zeros (1,6)), y3, eps) -***** assert (gpcdf (x, -1, ones (1,6), 0), y3, eps) -***** assert (gpcdf (x, -ones (1,6), 1, 0), y3, eps) -***** assert (gpcdf (x, -1, 1, 0), y3, eps) -***** assert (gpcdf (x, -1, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf (x, -1, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf (x, [-1, -1, -1, NaN, -1, -1], 1, 0), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf ([x(1:3), NaN, x(5:6)], -1, 1, 0), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, single (1), 0), single ([y1, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], single (0), 1, 0), single ([y1, NaN]), eps('single')) -***** assert (gpcdf (single ([x, NaN]), 1, 1, 0), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 1, 1, single (0)), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 1, single (1), 0), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], single (1), 1, 0), single ([y2, NaN]), eps('single')) -***** assert (gpcdf (single ([x, NaN]), -1, 1, 0), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], -1, 1, single (0)), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], -1, single (1), 0), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], single (-1), 1, 0), single ([y3, NaN]), eps('single')) -***** error gpcdf () -***** error gpcdf (1) -***** error gpcdf (1,2) -***** error gpcdf (1,2,3) -***** error gpcdf (1,2,3,4,5) -***** error gpcdf (ones (3), ones (2), ones (2), ones (2)) -***** error gpcdf (ones (2), ones (2), ones (2), ones (3)) -***** error gpcdf (ones (2), ones (2), ones (3), ones (2)) -***** error gpcdf (ones (2), ones (3), ones (2), ones (2)) -***** error gpcdf (i, 2, 2, 2) -***** error gpcdf (2, i, 2, 2) -***** error gpcdf (2, 2, i, 2) -***** error gpcdf (2, 2, 2, i) -52 tests, 52 passed, 0 known failure, 0 skipped -[inst/normstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/normstat.m + x = 8:0.1:12; + [h, pval, ci] = ttest (x, 10); + assert (h, 0) + assert (pval, 1, 10*eps) + assert (ci, [9.6219 10.3781], 1E-5) + [h, pval, ci0] = ttest (x, 0); + assert (h, 1) + assert (pval, 0) + assert (ci0, ci, 2e-15) + [h, pval, ci] = ttest (x, 10, "tail", "right", "dim", 2, "alpha", 0.05); + assert (h, 0) + assert (pval, 0.5, 10*eps) + assert (ci, [9.68498 Inf], 1E-5) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/expstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/expstat.m ***** test - m = 1:6; - s = 0.2:0.2:1.2; - [mn, v] = normstat (m, s); - expected_v = [0.0400, 0.1600, 0.3600, 0.6400, 1.0000, 1.4400]; - assert (mn, m); + l = 1:6; + [m, v] = expstat (l); + assert (m, [1, 2, 3, 4, 5, 6], 0.001); + assert (v, [1, 4, 9, 16, 25, 36], 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/nbinstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/nbinstat.m +***** test + n = 1:4; + p = 0.2:0.2:0.8; + [m, v] = nbinstat (n, p); + expected_m = [ 4.0000, 3.0000, 2.0000, 1.0000]; + expected_v = [20.0000, 7.5000, 3.3333, 1.2500]; + assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); ***** test - s = 0.2:0.2:1.2; - [mn, v] = normstat (0, s); - expected_mn = [0, 0, 0, 0, 0, 0]; - expected_v = [0.0400, 0.1600, 0.3600, 0.6400, 1.0000, 1.4400]; - assert (mn, expected_mn, 0.001); + n = 1:4; + [m, v] = nbinstat (n, 0.5); + expected_m = [1, 2, 3, 4]; + expected_v = [2, 4, 6, 8]; + assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gevlike.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevlike.m -***** test - x = 1; - k = 0.2; - sigma = 0.3; - mu = 0.5; - [L, D, C] = gevlike ([k sigma mu], x); - expected_L = 0.75942; - expected_D = [0.53150; -0.67790; -2.40674]; - expected_C = [-0.12547 1.77884 1.06731; 1.77884 16.40761 8.48877; 1.06731 8.48877 0.27979]; - assert (L, expected_L, 0.001); - assert (D, expected_D, 0.001); - assert (C, expected_C, 0.001); -***** test - x = 1; - k = 0; - sigma = 0.3; - mu = 0.5; - [L, D, C] = gevlike ([k sigma mu], x); - expected_L = 0.65157; - expected_D = [0.54011; -1.17291; -2.70375]; - expected_C = [0.090036 3.41229 2.047337; 3.412229 24.760027 12.510190; 2.047337 12.510190 2.098618]; - assert (L, expected_L, 0.001); - assert (D, expected_D, 0.001); - assert (C, expected_C, 0.001); +[inst/casewrite.m] +>>>>> /build/octave-statistics-1.4.2/inst/casewrite.m ***** test - x = -5:-1; - k = -0.2; - sigma = 0.3; - mu = 0.5; - [L, D, C] = gevlike ([k sigma mu], x); - expected_L = 3786.4; - expected_D = [6.4511e+04; -4.8194e+04; 3.0633e+03]; - expected_C = -[-1.4937e+06 1.0083e+06 -6.1837e+04; 1.0083e+06 -8.1138e+05 4.0917e+04; -6.1837e+04 4.0917e+04 -2.0422e+03]; - assert (L, expected_L, -0.001); - assert (D, expected_D, -0.001); - assert (C, expected_C, -0.001); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/hmmgenerate.m] ->>>>> /build/octave-statistics-1.4.2/inst/hmmgenerate.m + fname = [tempname() ".dat"]; + unwind_protect + s = ["a ";"bcd";"ef "]; + casewrite (s, fname) + names = caseread (fname); + unwind_protect_cleanup + unlink (fname); + end_unwind_protect + assert(names, s); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/raylinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/raylinv.m ***** test - len = 25; - transprob = [0.8, 0.2; 0.4, 0.6]; - outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; - [sequence, states] = hmmgenerate (len, transprob, outprob); - assert (length (sequence), len); - assert (length (states), len); - assert (min (sequence) >= 1); - assert (max (sequence) <= columns (outprob)); - assert (min (states) >= 1); - assert (max (states) <= rows (transprob)); + p = 0:0.1:0.5; + sigma = 1:6; + x = raylinv (p, sigma); + expected_x = [0.0000, 0.9181, 2.0041, 3.3784, 5.0538, 7.0645]; + assert (x, expected_x, 0.001); ***** test - len = 25; - transprob = [0.8, 0.2; 0.4, 0.6]; - outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; - symbols = {'A', 'B', 'C'}; - statenames = {'One', 'Two'}; - [sequence, states] = hmmgenerate (len, transprob, outprob, 'symbols', symbols, 'statenames', statenames); - assert (length (sequence), len); - assert (length (states), len); - assert (strcmp (sequence, 'A') + strcmp (sequence, 'B') + strcmp (sequence, 'C') == ones (1, len)); - assert (strcmp (states, 'One') + strcmp (states, 'Two') == ones (1, len)); + p = 0:0.1:0.5; + x = raylinv (p, 0.5); + expected_x = [0.0000, 0.2295, 0.3340, 0.4223, 0.5054, 0.5887]; + assert (x, expected_x, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/burrpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/burrpdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 1/4, 1/9, 0]; -***** assert (burrpdf (x, ones(1,5), ones (1,5), ones (1,5)), y) -***** assert (burrpdf (x, 1, 1, 1), y) -***** assert (burrpdf (x, [1, 1, NaN, 1, 1], 1, 1), [y(1:2), NaN, y(4:5)]) -***** assert (burrpdf (x, 1, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)]) -***** assert (burrpdf (x, 1, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)]) -***** assert (burrpdf ([x, NaN], 1, 1, 1), [y, NaN]) -***** assert (burrpdf (single ([x, NaN]), 1, 1, 1), single ([y, NaN])) -***** assert (burrpdf ([x, NaN], single (1), 1, 1), single ([y, NaN])) -***** assert (burrpdf ([x, NaN], 1, single (1), 1), single ([y, NaN])) -***** assert (burrpdf ([x, NaN], 1, 1, single (1)), single ([y, NaN])) -***** error burrpdf () -***** error burrpdf (1) -***** error burrpdf (1,2) -***** error burrpdf (1,2,3) -***** error burrpdf (1,2,3,4,5) -***** error burrpdf (ones (3), ones (2), ones(2), ones(2)) -***** error burrpdf (ones (2), ones (3), ones(2), ones(2)) -***** error burrpdf (ones (2), ones (2), ones(3), ones(2)) -***** error burrpdf (ones (2), ones (2), ones(2), ones(3)) -***** error burrpdf (i, 2, 2, 2) -***** error burrpdf (2, i, 2, 2) -***** error burrpdf (2, 2, i, 2) -***** error burrpdf (2, 2, 2, i) -23 tests, 23 passed, 0 known failure, 0 skipped -[inst/mvnpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/mvnpdf.m -***** demo - mu = [0, 0]; - sigma = [1, 0.1; 0.1, 0.5]; - [X, Y] = meshgrid (linspace (-3, 3, 25)); - XY = [X(:), Y(:)]; - Z = mvnpdf (XY, mu, sigma); - mesh (X, Y, reshape (Z, size (X))); - colormap jet -***** test - mu = [1,-1]; - sigma = [.9 .4; .4 .3]; - x = [ 0.5 -1.2; -0.5 -1.4; 0 -1.5]; - p = [ 0.41680003660313; 0.10278162359708; 0.27187267524566 ]; - q = mvnpdf (x, mu, sigma); - assert (p, q, 10*eps); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/binotest.m] ->>>>> /build/octave-statistics-1.4.2/inst/binotest.m -***** demo - % flip a coin 1000 times, showing 475 heads - % Hypothesis: coin is fair, i.e. p=1/2 - [h,p_val,ci] = binotest(475,1000,0.5) - % Result: h = 0 : null hypothesis not rejected, coin could be fair - % P value 0.12, i.e. hypothesis not rejected for alpha up to 12% - % 0.444 <= p <= 0.506 with 95% confidence -***** demo - % flip a coin 100 times, showing 65 heads - % Hypothesis: coin shows less than 50% heads, i.e. p<=1/2 - [h,p_val,ci] = binotest(65,100,0.5,'tail','left','alpha',0.01) - % Result: h = 1 : null hypothesis is rejected, i.e. coin shows more heads than tails - % P value 0.0018, i.e. hypothesis not rejected for alpha up to 0.18% - % 0 <= p <= 0.76 with 99% confidence -***** test #example from https://en.wikipedia.org/wiki/Binomial_test - [h,p_val,ci] = binotest (51,235,1/6); - assert (p_val, 0.0437, 0.00005) - [h,p_val,ci] = binotest (51,235,1/6,'tail','left'); - assert (p_val, 0.027, 0.0005) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/regress.m] ->>>>> /build/octave-statistics-1.4.2/inst/regress.m -***** test - % Longley data from the NIST Statistical Reference Dataset - Z = [ 60323 83.0 234289 2356 1590 107608 1947 - 61122 88.5 259426 2325 1456 108632 1948 - 60171 88.2 258054 3682 1616 109773 1949 - 61187 89.5 284599 3351 1650 110929 1950 - 63221 96.2 328975 2099 3099 112075 1951 - 63639 98.1 346999 1932 3594 113270 1952 - 64989 99.0 365385 1870 3547 115094 1953 - 63761 100.0 363112 3578 3350 116219 1954 - 66019 101.2 397469 2904 3048 117388 1955 - 67857 104.6 419180 2822 2857 118734 1956 - 68169 108.4 442769 2936 2798 120445 1957 - 66513 110.8 444546 4681 2637 121950 1958 - 68655 112.6 482704 3813 2552 123366 1959 - 69564 114.2 502601 3931 2514 125368 1960 - 69331 115.7 518173 4806 2572 127852 1961 - 70551 116.9 554894 4007 2827 130081 1962 ]; - % Results certified by NIST using 500 digit arithmetic - % b and standard error in b - V = [ -3482258.63459582 890420.383607373 - 15.0618722713733 84.9149257747669 - -0.358191792925910E-01 0.334910077722432E-01 - -2.02022980381683 0.488399681651699 - -1.03322686717359 0.214274163161675 - -0.511041056535807E-01 0.226073200069370 - 1829.15146461355 455.478499142212 ]; - Rsq = 0.995479004577296; - F = 330.285339234588; - y = Z(:,1); X = [ones(rows(Z),1), Z(:,2:end)]; - alpha = 0.05; - [b, bint, r, rint, stats] = regress (y, X, alpha); - assert(b,V(:,1),3e-6); - assert(stats(1),Rsq,1e-12); - assert(stats(2),F,3e-8); - assert(((bint(:,1)-bint(:,2))/2)/tinv(alpha/2,9),V(:,2),-1.e-5); -warning: matrix singular to machine precision, rcond = 3.50566e-20 +[inst/pdist.m] +>>>>> /build/octave-statistics-1.4.2/inst/pdist.m +***** shared xy, t, eucl + xy = [0 1; 0 2; 7 6; 5 6]; + t = 1e-3; + eucl = @(v,m) sqrt(sumsq(repmat(v,rows(m),1)-m,2)); +***** assert(pdist(xy), [1.000 8.602 7.071 8.062 6.403 2.000],t); +***** assert(pdist(xy,eucl), [1.000 8.602 7.071 8.062 6.403 2.000],t); +***** assert(pdist(xy,"euclidean"), [1.000 8.602 7.071 8.062 6.403 2.000],t); +***** assert(pdist(xy,"seuclidean"), [0.380 2.735 2.363 2.486 2.070 0.561],t); +***** assert(pdist(xy,"mahalanobis"),[1.384 1.967 2.446 2.384 1.535 2.045],t); +***** assert(pdist(xy,"cityblock"), [1.000 12.00 10.00 11.00 9.000 2.000],t); +***** assert(pdist(xy,"minkowski"), [1.000 8.602 7.071 8.062 6.403 2.000],t); +***** assert(pdist(xy,"minkowski",3),[1.000 7.763 6.299 7.410 5.738 2.000],t); +***** assert(pdist(xy,"cosine"), [0.000 0.349 0.231 0.349 0.231 0.013],t); +***** assert(pdist(xy,"correlation"),[0.000 2.000 0.000 2.000 0.000 2.000],t); +***** assert(pdist(xy,"spearman"), [0.000 2.000 0.000 2.000 0.000 2.000],t); +***** assert(pdist(xy,"hamming"), [0.500 1.000 1.000 1.000 1.000 0.500],t); +***** assert(pdist(xy,"jaccard"), [1.000 1.000 1.000 1.000 1.000 0.500],t); +***** assert(pdist(xy,"chebychev"), [1.000 7.000 5.000 7.000 5.000 2.000],t); +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/linkage.m] +>>>>> /build/octave-statistics-1.4.2/inst/linkage.m +***** shared x, t + x = reshape(mod(magic(6),5),[],3); + t = 1e-6; +***** assert (cond (linkage (pdist (x))), 34.119045,t); +***** assert (cond (linkage (pdist (x), "complete")), 21.793345,t); +***** assert (cond (linkage (pdist (x), "average")), 27.045012,t); +***** assert (cond (linkage (pdist (x), "weighted")), 27.412889,t); + lastwarn(); # Clear last warning before the test +***** warning linkage (pdist (x), "centroid"); +***** test warning off clustering + assert (cond (linkage (pdist (x), "centroid")), 27.457477,t); + warning on clustering +warning: clustering warning: called from - regress at line 134 column 7 - __test__ at line 33 column 28 + linkage at line 169 column 5 + __test__ at line 3 column 2 test at line 677 column 11 - /tmp/tmp.8RcEwdXUFp at line 86 column 31 + /tmp/tmp.J1MIIy9ZIU at line 78 column 31 -1 test, 1 passed, 0 known failure, 0 skipped -[inst/bbspdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/bbspdf.m +***** warning linkage (pdist (x), "median"); +***** test warning off clustering + assert (cond (linkage (pdist (x), "median")), 27.683325,t); + warning on clustering +warning: clustering +warning: called from + linkage at line 169 column 5 + __test__ at line 3 column 2 + test at line 677 column 11 + /tmp/tmp.J1MIIy9ZIU at line 78 column 31 + +***** assert (cond (linkage (pdist (x), "ward")), 17.195198,t); +***** assert (cond (linkage(x,"ward","euclidean")), 17.195198,t); +***** assert (cond (linkage(x,"ward",{"euclidean"})), 17.195198,t); +***** assert (cond (linkage(x,"ward",{"minkowski",2})),17.195198,t); +12 tests, 12 passed, 0 known failure, 0 skipped +[inst/tricdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/tricdf.m ***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 0.3989422804014327, 0.1647717335503959, 0]; -***** assert (bbspdf (x, ones (1,5), ones (1,5), zeros (1,5)), y, eps) -***** assert (bbspdf (x, 1, 1, zeros (1,5)), y, eps) -***** assert (bbspdf (x, 1, ones (1,5), 0), y, eps) -***** assert (bbspdf (x, ones (1,5), 1, 0), y, eps) -***** assert (bbspdf (x, 1, 1, 0), y, eps) -***** assert (bbspdf (x, 1, 1, [0, 0, NaN, 0, 0]), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf (x, 1, [1, 1, NaN, 1, 1], 0), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf (x, [1, 1, NaN, 1, 1], 1, 0), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf ([x, NaN], 1, 1, 0), [y, NaN], eps) -***** assert (bbspdf (single ([x, NaN]), 1, 1, 0), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], 1, 1, single (0)), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], 1, single (1), 0), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], single (1), 1, 0), single ([y, NaN]), eps('single')) -***** error bbspdf () -***** error bbspdf (1) -***** error bbspdf (1,2,3) -***** error bbspdf (1,2,3,4,5) -***** error bbspdf (ones (3), ones (2), ones(2), ones(2)) -***** error bbspdf (ones (2), ones (3), ones(2), ones(2)) -***** error bbspdf (ones (2), ones (2), ones(3), ones(2)) -***** error bbspdf (ones (2), ones (2), ones(2), ones(3)) -***** error bbspdf (i, 4, 3, 2) -***** error bbspdf (1, i, 3, 2) -***** error bbspdf (1, 4, i, 2) -***** error bbspdf (1, 4, 3, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/gevcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevcdf.m -***** test - x = 0:0.5:2.5; - sigma = 1:6; - k = 1; - mu = 0; - p = gevcdf (x, k, sigma, mu); - expected_p = [0.36788 0.44933 0.47237 0.48323 0.48954 0.49367]; - assert (p, expected_p, 0.001); -***** test - x = -0.5:0.5:2.5; - sigma = 0.5; - k = 1; - mu = 0; - p = gevcdf (x, k, sigma, mu); - expected_p = [0 0.36788 0.60653 0.71653 0.77880 0.81873 0.84648]; - assert (p, expected_p, 0.001); -***** test #check for continuity for k near 0 - x = 1; - sigma = 0.5; - k = -0.03:0.01:0.03; - mu = 0; - p = gevcdf (x, k, sigma, mu); - expected_p = [0.88062 0.87820 0.87580 0.87342 0.87107 0.86874 0.86643]; - assert (p, expected_p, 0.001); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/bbsrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/bbsrnd.m -***** assert (size (bbsrnd (1, 1, 0)), [1 1]) -***** assert (size (bbsrnd (1, 1, zeros (2,1))), [2, 1]) -***** assert (size (bbsrnd (1, 1, zeros (2,2))), [2, 2]) -***** assert (size (bbsrnd (1, ones (2,1), 0)), [2, 1]) -***** assert (size (bbsrnd (1, ones (2,2), 0)), [2, 2]) -***** assert (size (bbsrnd (ones (2,1), 1, 0)), [2, 1]) -***** assert (size (bbsrnd (ones (2,2), 1, 0)), [2, 2]) -***** assert (size (bbsrnd (1, 1, 0, 3)), [3, 3]) -***** assert (size (bbsrnd (1, 1, 0, [4 1])), [4, 1]) -***** assert (size (bbsrnd (1, 1, 0, 4, 1)), [4, 1]) -***** assert (class (bbsrnd (1,1,0)), "double") -***** assert (class (bbsrnd (1, 1, single (0))), "single") -***** assert (class (bbsrnd (1, 1, single ([0 0]))), "single") -***** assert (class (bbsrnd (1, single (1), 0)), "single") -***** assert (class (bbsrnd (1, single ([1 1]), 0)), "single") -***** assert (class (bbsrnd (single (1), 1, 0)), "single") -***** assert (class (bbsrnd (single ([1 1]), 1, 0)), "single") -***** error bbsrnd () -***** error bbsrnd (1) -***** error bbsrnd (1,2) -***** error bbsrnd (ones (3), ones (2), ones (2), 2) -***** error bbsrnd (ones (2), ones (3), ones (2), 2) -***** error bbsrnd (ones (2), ones (2), ones (3), 2) -***** error bbsrnd (i, 2, 3) -***** error bbsrnd (1, i, 3) -***** error bbsrnd (1, 2, i) -***** error bbsrnd (1,2,3, -1) -***** error bbsrnd (1,2,3, ones (2)) -***** error bbsrnd (1,2,3, [2 -1 2]) -***** error bbsrnd (2, 1, ones (2), 3) -***** error bbsrnd (2, 1, ones (2), [3, 2]) -***** error bbsrnd (2, 1, ones (2), 3, 2) -32 tests, 32 passed, 0 known failure, 0 skipped -[inst/cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/cdf.m -***** test - assert(cdf ('norm', 1, 0, 1), normcdf (1, 0, 1)) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/bbsinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/bbsinv.m -***** shared x,y,f - f = @(x,a,b,c) (a + b * (c * norminv (x) + sqrt (4 + (c * norminv(x))^2))^2) / 4; - x = [-1, 0, 1/4, 1/2, 1, 2]; - y = [0, 0, f(1/4, 0, 1, 1), 1, Inf, NaN]; -***** assert (bbsinv (x, ones (1,6), ones (1,6), zeros (1,6)), y) -***** assert (bbsinv (x, 1, 1, zeros (1,6)), y) -***** assert (bbsinv (x, 1, ones (1,6), 0), y) -***** assert (bbsinv (x, ones (1,6), 1, 0), y) -***** assert (bbsinv (x, 1, 1, 0), y) -***** assert (bbsinv (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv ([x, NaN], 1, 1, 0), [y, NaN]) -***** assert (bbsinv (single ([x, NaN]), 1, 1, 0), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], 1, 1, single (0)), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], 1, single (1), 0), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], single (1), 1, 0), single ([y, NaN])) -***** error bbsinv () -***** error bbsinv (1) -***** error bbsinv (1,2,3) -***** error bbsinv (1,2,3,4,5) -***** error bbsinv (ones (3), ones (2), ones(2), ones(2)) -***** error bbsinv (ones (2), ones (3), ones(2), ones(2)) -***** error bbsinv (ones (2), ones (2), ones(3), ones(2)) -***** error bbsinv (ones (2), ones (2), ones(2), ones(3)) -***** error bbsinv (i, 4, 3, 2) -***** error bbsinv (1, i, 3, 2) -***** error bbsinv (1, 4, i, 2) -***** error bbsinv (1, 4, 3, i) + x = [-1, 0, 0.1, 0.5, 0.9, 1, 2] + 1; + y = [0, 0, 0.02, 0.5, 0.98, 1 1]; +***** assert (tricdf (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, eps) +***** assert (tricdf (x, 1*ones (1,7), 2, 1.5), y, eps) +***** assert (tricdf (x, 1, 2*ones (1,7), 1.5), y, eps) +***** assert (tricdf (x, 1, 2, 1.5*ones (1,7)), y, eps) +***** assert (tricdf (x, 1, 2, 1.5), y, eps) +***** assert (tricdf (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], eps) +***** assert (tricdf (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], eps) +***** assert (tricdf (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], eps) +***** assert (tricdf ([x, NaN], 1, 2, 1.5), [y, NaN], eps) +***** assert (tricdf (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (tricdf ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (tricdf ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) +***** assert (tricdf ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) +***** error tricdf () +***** error tricdf (1) +***** error tricdf (1,2) +***** error tricdf (1,2,3) +***** error tricdf (1,2,3,4,5) +***** error tricdf (1, ones (3), ones (2), ones (2)) +***** error tricdf (1, ones (2), ones (3), ones (2)) +***** error tricdf (1, ones (2), ones (2), ones (3)) +***** error tricdf (i, 2, 2, 2) +***** error tricdf (2, i, 2, 2) +***** error tricdf (2, 2, i, 2) +***** error tricdf (2, 2, 2, i) 25 tests, 25 passed, 0 known failure, 0 skipped [inst/normalise_distribution.m] >>>>> /build/octave-statistics-1.4.2/inst/normalise_distribution.m @@ -3028,211 +2854,35 @@ fail ("normalise_distribution( zeros ( 3, 4 ), { @unifcdf; @normcdf; @( x )( expcdf ( x, 1 ) ) } )", ... "Number of distributions does not match data size!"); 13 tests, 13 passed, 0 known failure, 0 skipped -[inst/hist3.m] ->>>>> /build/octave-statistics-1.4.2/inst/hist3.m -***** demo - X = [ - 1 1 - 1 1 - 1 10 - 1 10 - 5 5 - 5 5 - 5 5 - 5 5 - 5 5 - 7 3 - 7 3 - 7 3 - 10 10 - 10 10]; - hist3 (X) -***** test - N_exp = [ 0 0 0 5 20 - 0 0 10 15 0 - 0 15 10 0 0 - 20 5 0 0 0]; - - n = 100; - x = [1:n]'; - y = [n:-1:1]'; - D = [x y]; - N = hist3 (D, [4 5]); - assert (N, N_exp); -***** test - N_exp = [0 0 0 0 1 - 0 0 0 0 1 - 0 0 0 0 1 - 1 1 1 1 93]; - - n = 100; - x = [1:n]'; - y = [n:-1:1]'; - D = [x y]; - C{1} = [1 1.7 3 4]; - C{2} = [1:5]; - N = hist3 (D, C); - assert (N, N_exp); -***** test - D = [1 1; 3 1; 3 3; 3 1]; - [c, nn] = hist3 (D, {0:4, 0:4}); - exp_c = zeros (5); - exp_c([7 9 19]) = [1 2 1]; - assert (c, exp_c); - assert (nn, {0:4, 0:4}); -***** test - for i = 10 - assert (size (hist3 (rand (9, 2), "Edges", {[0:.2:1]; [0:.2:1]})), [6 6]) - endfor -***** test - edge_1 = linspace (0, 10, 10); - edge_2 = linspace (0, 50, 10); - [c, nn] = hist3 ([1:10; 1:5:50]', "Edges", {edge_1, edge_2}); - exp_c = zeros (10, 10); - exp_c([1 12 13 24 35 46 57 68 79 90]) = 1; - assert (c, exp_c); - - assert (nn{1}, edge_1 + edge_1(2)/2, eps*10^4) - assert (nn{2}, edge_2 + edge_2(2)/2, eps*10^4) -***** shared X - X = [ - 5 2 - 5 3 - 1 4 - 5 3 - 4 4 - 1 2 - 2 3 - 3 3 - 5 4 - 5 3]; -***** test - N = zeros (10); - N([1 10 53 56 60 91 98 100]) = [1 1 1 1 3 1 1 1]; - C = {(1.2:0.4:4.8), (2.1:0.2:3.9)}; - assert (nthargout ([1 2], @hist3, X), {N C}, eps*10^3) -***** test - N = zeros (5, 7); - N([1 5 17 18 20 31 34 35]) = [1 1 1 1 3 1 1 1]; - C = {(1.4:0.8:4.6), ((2+(1/7)):(2/7):(4-(1/7)))}; - assert (nthargout ([1 2], @hist3, X, [5 7]), {N C}, eps*10^3) - assert (nthargout ([1 2], @hist3, X, "Nbins", [5 7]), {N C}, eps*10^3) -***** test - N = [0 1 0; 0 1 0; 0 0 1; 0 0 0]; - C = {(2:5), (2.5:1:4.5)}; - assert (nthargout ([1 2], @hist3, X, "Edges", {(1.5:4.5), (2:4)}), {N C}) -***** test - N = [0 0 1 0 1 0; 0 0 0 1 0 0; 0 0 1 4 2 0]; - C = {(1.2:3.2), (0:5)}; - assert (nthargout ([1 2], @hist3, X, "Ctrs", C), {N C}) - assert (nthargout ([1 2], @hist3, X, C), {N C}) -***** test - [~, C] = hist3 (rand (10, 2), "Edges", {[0 .05 .15 .35 .55 .95], - [-1 .05 .07 .2 .3 .5 .89 1.2]}); - C_exp = {[ 0.025 0.1 0.25 0.45 0.75 1.15], ... - [-0.475 0.06 0.135 0.25 0.4 0.695 1.045 1.355]}; - assert (C, C_exp, eps*10^2) -***** test - Xv = repmat ([1:10]', [1 2]); - - ## Test Centers - assert (hist3 (Xv, "Ctrs", {1:10, 1:10}), eye (10)) - - N_exp = eye (6); - N_exp([1 end]) = 3; - assert (hist3 (Xv, "Ctrs", {3:8, 3:8}), N_exp) - - N_exp = zeros (8, 6); - N_exp([1 2 11 20 29 38 47 48]) = [2 1 1 1 1 1 1 2]; - assert (hist3 (Xv, "Ctrs", {2:9, 3:8}), N_exp) - - ## Test Edges - assert (hist3 (Xv, "Edges", {1:10, 1:10}), eye (10)) - assert (hist3 (Xv, "Edges", {3:8, 3:8}), eye (6)) - assert (hist3 (Xv, "Edges", {2:9, 3:8}), [zeros(1, 6); eye(6); zeros(1, 6)]) - - N_exp = zeros (14); - N_exp(3:12, 3:12) = eye (10); - assert (hist3 (Xv, "Edges", {-1:12, -1:12}), N_exp) - - ## Test for Nbins - assert (hist3 (Xv), eye (10)) - assert (hist3 (Xv, [10 10]), eye (10)) - assert (hist3 (Xv, "nbins", [10 10]), eye (10)) - assert (hist3 (Xv, [5 5]), eye (5) * 2) - - N_exp = zeros (7, 5); - N_exp([1 9 10 18 26 27 35]) = [2 1 1 2 1 1 2]; - assert (hist3 (Xv, [7 5]), N_exp) -***** test # bug #51059 - D = [1 1; NaN 2; 3 1; 3 3; 1 NaN; 3 1]; - [c, nn] = hist3 (D, {0:4, 0:4}); - exp_c = zeros (5); - exp_c([7 9 19]) = [1 2 1]; - assert (c, exp_c) - assert (nn, {0:4, 0:4}) -***** test - [c, nn] = hist3 ([1 8]); - exp_c = zeros (10, 10); - exp_c(6, 6) = 1; - exp_nn = {-4:5, 3:12}; - assert (c, exp_c) - assert (nn, exp_nn, eps) - - [c, nn] = hist3 ([1 8], [10 11]); - exp_c = zeros (10, 11); - exp_c(6, 6) = 1; - exp_nn = {-4:5, 3:13}; - assert (c, exp_c) - assert (nn, exp_nn, eps) -***** test - [c, nn] = hist3 ([1 NaN; 2 3; 6 9; 8 NaN]); - exp_c = zeros (10, 10); - exp_c(2, 1) = 1; - exp_c(8, 10) = 1; - exp_nn = {linspace(1.35, 7.65, 10) linspace(3.3, 8.7, 10)}; - assert (c, exp_c) - assert (nn, exp_nn, eps*100) -***** test - [c, nn] = hist3 ([1 NaN; 2 NaN; 6 NaN; 8 NaN]); - exp_c = zeros (10, 10); - exp_nn = {linspace(1.35, 7.65, 10) NaN(1, 10)}; - assert (c, exp_c) - assert (nn, exp_nn, eps*100) -***** test - [c, nn] = hist3 ([1 NaN; NaN 3; NaN 9; 8 NaN]); - exp_c = zeros (10, 10); - exp_nn = {linspace(1.35, 7.65, 10) linspace(3.3, 8.7, 10)}; - assert (c, exp_c) - assert (nn, exp_nn, eps*100) -16 tests, 16 passed, 0 known failure, 0 skipped -[inst/gevpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevpdf.m -***** test - x = 0:0.5:2.5; - sigma = 1:6; - k = 1; - mu = 0; - y = gevpdf (x, k, sigma, mu); - expected_y = [0.367879 0.143785 0.088569 0.063898 0.049953 0.040997]; - assert (y, expected_y, 0.001); -***** test - x = -0.5:0.5:2.5; - sigma = 0.5; - k = 1; - mu = 0; - y = gevpdf (x, k, sigma, mu); - expected_y = [0 0.735759 0.303265 0.159229 0.097350 0.065498 0.047027]; - assert (y, expected_y, 0.001); -***** test #check for continuity for k near 0 - x = 1; - sigma = 0.5; - k = -0.03:0.01:0.03; - mu = 0; - y = gevpdf (x, k, sigma, mu); - expected_y = [0.23820 0.23764 0.23704 0.23641 0.23576 0.23508 0.23438]; - assert (y, expected_y, 0.001); -3 tests, 3 passed, 0 known failure, 0 skipped +[inst/binotest.m] +>>>>> /build/octave-statistics-1.4.2/inst/binotest.m +***** demo + % flip a coin 1000 times, showing 475 heads + % Hypothesis: coin is fair, i.e. p=1/2 + [h,p_val,ci] = binotest(475,1000,0.5) + % Result: h = 0 : null hypothesis not rejected, coin could be fair + % P value 0.12, i.e. hypothesis not rejected for alpha up to 12% + % 0.444 <= p <= 0.506 with 95% confidence +***** demo + % flip a coin 100 times, showing 65 heads + % Hypothesis: coin shows less than 50% heads, i.e. p<=1/2 + [h,p_val,ci] = binotest(65,100,0.5,'tail','left','alpha',0.01) + % Result: h = 1 : null hypothesis is rejected, i.e. coin shows more heads than tails + % P value 0.0018, i.e. hypothesis not rejected for alpha up to 0.18% + % 0 <= p <= 0.76 with 99% confidence +***** test #example from https://en.wikipedia.org/wiki/Binomial_test + [h,p_val,ci] = binotest (51,235,1/6); + assert (p_val, 0.0437, 0.00005) + [h,p_val,ci] = binotest (51,235,1/6,'tail','left'); + assert (p_val, 0.027, 0.0005) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/cmdscale.m] +>>>>> /build/octave-statistics-1.4.2/inst/cmdscale.m +***** shared m, n, X, D + m = randi(100) + 1; n = randi(100) + 1; X = rand(m, n); D = pdist(X); +***** assert(norm(pdist(cmdscale(D))), norm(D), sqrt(eps)) +***** assert(norm(pdist(cmdscale(squareform(D)))), norm(D), sqrt(eps)) +2 tests, 2 passed, 0 known failure, 0 skipped [inst/caseread.m] >>>>> /build/octave-statistics-1.4.2/inst/caseread.m ***** shared n, casereadfile @@ -3240,474 +2890,136 @@ casereadfile = file_in_loadpath("test/caseread.dat"); ***** assert (caseread (casereadfile), n); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/pdist.m] ->>>>> /build/octave-statistics-1.4.2/inst/pdist.m -***** shared xy, t, eucl - xy = [0 1; 0 2; 7 6; 5 6]; - t = 1e-3; - eucl = @(v,m) sqrt(sumsq(repmat(v,rows(m),1)-m,2)); -***** assert(pdist(xy), [1.000 8.602 7.071 8.062 6.403 2.000],t); -***** assert(pdist(xy,eucl), [1.000 8.602 7.071 8.062 6.403 2.000],t); -***** assert(pdist(xy,"euclidean"), [1.000 8.602 7.071 8.062 6.403 2.000],t); -***** assert(pdist(xy,"seuclidean"), [0.380 2.735 2.363 2.486 2.070 0.561],t); -***** assert(pdist(xy,"mahalanobis"),[1.384 1.967 2.446 2.384 1.535 2.045],t); -***** assert(pdist(xy,"cityblock"), [1.000 12.00 10.00 11.00 9.000 2.000],t); -***** assert(pdist(xy,"minkowski"), [1.000 8.602 7.071 8.062 6.403 2.000],t); -***** assert(pdist(xy,"minkowski",3),[1.000 7.763 6.299 7.410 5.738 2.000],t); -***** assert(pdist(xy,"cosine"), [0.000 0.349 0.231 0.349 0.231 0.013],t); -***** assert(pdist(xy,"correlation"),[0.000 2.000 0.000 2.000 0.000 2.000],t); -***** assert(pdist(xy,"spearman"), [0.000 2.000 0.000 2.000 0.000 2.000],t); -***** assert(pdist(xy,"hamming"), [0.500 1.000 1.000 1.000 1.000 0.500],t); -***** assert(pdist(xy,"jaccard"), [1.000 1.000 1.000 1.000 1.000 0.500],t); -***** assert(pdist(xy,"chebychev"), [1.000 7.000 5.000 7.000 5.000 2.000],t); -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/hmmestimate.m] ->>>>> /build/octave-statistics-1.4.2/inst/hmmestimate.m -***** test - sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; - states = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; - [transprobest, outprobest] = hmmestimate (sequence, states); - expectedtransprob = [0.88889, 0.11111; 0.28571, 0.71429]; - expectedoutprob = [0.16667, 0.33333, 0.50000; 1.00000, 0.00000, 0.00000]; - assert (transprobest, expectedtransprob, 0.001); - assert (outprobest, expectedoutprob, 0.001); -***** test - sequence = {'A', 'B', 'A', 'A', 'A', 'B', 'B', 'A', 'B', 'C', 'C', 'C', 'C', 'B', 'C', 'A', 'A', 'A', 'A', 'C', 'C', 'B', 'C', 'A', 'C'}; - states = {'One', 'One', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'Two', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One'}; - symbols = {'A', 'B', 'C'}; - statenames = {'One', 'Two'}; - [transprobest, outprobest] = hmmestimate (sequence, states, 'symbols', symbols, 'statenames', statenames); - expectedtransprob = [0.88889, 0.11111; 0.28571, 0.71429]; - expectedoutprob = [0.16667, 0.33333, 0.50000; 1.00000, 0.00000, 0.00000]; - assert (transprobest, expectedtransprob, 0.001); - assert (outprobest, expectedoutprob, 0.001); -***** test - sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; - states = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; - pseudotransitions = [8, 2; 4, 6]; - pseudoemissions = [2, 4, 4; 7, 2, 1]; - [transprobest, outprobest] = hmmestimate (sequence, states, 'pseudotransitions', pseudotransitions, 'pseudoemissions', pseudoemissions); - expectedtransprob = [0.85714, 0.14286; 0.35294, 0.64706]; - expectedoutprob = [0.178571, 0.357143, 0.464286; 0.823529, 0.117647, 0.058824]; - assert (transprobest, expectedtransprob, 0.001); - assert (outprobest, expectedoutprob, 0.001); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/squareform.m] ->>>>> /build/octave-statistics-1.4.2/inst/squareform.m -***** shared v, m - v = 1:6; - m = [0 1 2 3;1 0 4 5;2 4 0 6;3 5 6 0]; -***** assert (squareform (v), m) -***** assert (squareform (squareform (v)), v) -***** assert (squareform (m), v) -***** assert (squareform (v'), m) -***** assert (squareform (1), [0 1;1 0]) -***** assert (squareform (1, "tomatrix"), [0 1; 1 0]) -***** assert (squareform (0, "tovector"), zeros (1, 0)) -***** warning squareform ([0 1 2; 3 0 4; 5 6 0]); -***** test - for c = {@single, @double, @uint8, @uint32, @uint64} - f = c{1}; - assert (squareform (f (v)), f (m)) - assert (squareform (f (m)), f (v)) - endfor -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/unifstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/unifstat.m -***** test - a = 1:6; - b = 2:2:12; - [m, v] = unifstat (a, b); - expected_m = [1.5000, 3.0000, 4.5000, 6.0000, 7.5000, 9.0000]; - expected_v = [0.0833, 0.3333, 0.7500, 1.3333, 2.0833, 3.0000]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -***** test - a = 1:6; - [m, v] = unifstat (a, 10); - expected_m = [5.5000, 6.0000, 6.5000, 7.0000, 7.5000, 8.0000]; - expected_v = [6.7500, 5.3333, 4.0833, 3.0000, 2.0833, 1.3333]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/sigma_pts.m] ->>>>> /build/octave-statistics-1.4.2/inst/sigma_pts.m -***** demo - K = [1 0.5; 0.5 1]; # covaraince matrix - # calculate and build associated ellipse - [R,S,~] = svd (K); - theta = atan2 (R(2,1), R(1,1)); - v = sqrt (diag (S)); - v = v .* [cos(theta) sin(theta); -sin(theta) cos(theta)]; - t = linspace (0, 2*pi, 100).'; - xe = v(1,1) * cos (t) + v(2,1) * sin (t); - ye = v(1,2) * cos (t) + v(2,2) * sin (t); - - figure(1); clf; hold on - # Plot ellipse and axes - line ([0 0; v(:,1).'],[0 0; v(:,2).']) - plot (xe,ye,'-r'); - - col = 'rgb'; - l = [-1.8 -1 1.5]; - for li = 1:3 - p = sigma_pts (2, [], K, l(li)); - tmp = plot (p(2:end,1), p(2:end,2), ['x' col(li)], ... - p(1,1), p(1,2), ['o' col(li)]); - h(li) = tmp(1); - endfor - hold off - axis image - legend (h, arrayfun (@(x) sprintf ("l:%.2g", x), l, "unif", 0)); -***** test - p = sigma_pts (5); - assert (mean (p), zeros(1,5), sqrt(eps)); - assert (cov (p), eye(5), sqrt(eps)); -***** test - m = randn(1, 5); - p = sigma_pts (5, m); - assert (mean (p), m, sqrt(eps)); - assert (cov (p), eye(5), sqrt(eps)); -***** test - x = linspace (0,1,5); - K = exp (- (x.' - x).^2/ 0.5); - p = sigma_pts (5, [], K); - assert (mean (p), zeros(1,5), sqrt(eps)); - assert (cov (p), K, sqrt(eps)); -***** error sigma_pts(2,1); -***** error sigma_pts(2,[],1); -***** error sigma_pts(2,1,1); -***** error sigma_pts(2,[0.5 0.5],[-1 0; 0 0]); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/nakarnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/nakarnd.m -***** assert (size (nakarnd (1,1)), [1, 1]) -***** assert (size (nakarnd (ones (2,1), 1)), [2, 1]) -***** assert (size (nakarnd (ones (2,2), 1)), [2, 2]) -***** assert (size (nakarnd (1, ones (2,1))), [2, 1]) -***** assert (size (nakarnd (1, ones (2,2))), [2, 2]) -***** assert (size (nakarnd (1,1, 3)), [3, 3]) -***** assert (size (nakarnd (1,1, [4 1])), [4, 1]) -***** assert (size (nakarnd (1,1, 4, 1)), [4, 1]) -***** assert (class (nakarnd (1,1)), "double") -***** assert (class (nakarnd (single (1),1)), "single") -***** assert (class (nakarnd (single ([1 1]),1)), "single") -***** assert (class (nakarnd (1,single (1))), "single") -***** assert (class (nakarnd (1,single ([1 1]))), "single") -***** error nakarnd () -***** error nakarnd (1) -***** error nakarnd (zeros (3), ones (2)) -***** error nakarnd (zeros (2), ones (3)) -***** error nakarnd (i, 2) -***** error nakarnd (1, i) -***** error nakarnd (1,2, -1) -***** error nakarnd (1,2, ones (2)) -***** error nakarnd (1, 2, [2 -1 2]) -***** error nakarnd (1,2, 1, ones (2)) -***** error nakarnd (1,2, 1, -1) -***** error nakarnd (ones (2,2), 2, 3) -***** error nakarnd (ones (2,2), 2, [3, 2]) -***** error nakarnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/mvtrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/mvtrnd.m -***** test - sigma = [1, 0.5; 0.5, 1]; - nu = 3; - n = 10; - x = mvtrnd (sigma, nu, n); - assert (size (x), [10, 2]); -***** test - sigma = [1, 0.5; 0.5, 1]; - nu = [2; 3]; - n = 2; - x = mvtrnd (sigma, nu, 2); - assert (size (x), [2, 2]); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/nakainv.m] ->>>>> /build/octave-statistics-1.4.2/inst/nakainv.m -***** shared x,y - x = [-Inf, -1, 0, 1/2, 1, 2, Inf]; - y = [NaN, NaN, 0, 0.83255461115769769, Inf, NaN, NaN]; -***** assert (nakainv (x, ones (1,7), ones (1,7)), y, eps) -***** assert (nakainv (x, 1, 1), y, eps) -***** assert (nakainv (x, [1, 1, 1, NaN, 1, 1, 1], 1), [y(1:3), NaN, y(5:7)], eps) -***** assert (nakainv (x, 1, [1, 1, 1, NaN, 1, 1, 1]), [y(1:3), NaN, y(5:7)], eps) -***** assert (nakainv ([x, NaN], 1, 1), [y, NaN], eps) -***** assert (nakainv (single ([x, NaN]), 1, 1), single ([y, NaN])) -***** assert (nakainv ([x, NaN], single (1), 1), single ([y, NaN])) -***** assert (nakainv ([x, NaN], 1, single (1)), single ([y, NaN])) -***** error nakainv () -***** error nakainv (1) -***** error nakainv (1,2) -***** error nakainv (1,2,3,4) -***** error nakainv (ones (3), ones (2), ones(2)) -***** error nakainv (ones (2), ones (3), ones(2)) -***** error nakainv (ones (2), ones (2), ones(3)) -***** error nakainv (i, 2, 2) -***** error nakainv (2, i, 2) -***** error nakainv (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/runstest.m] ->>>>> /build/octave-statistics-1.4.2/inst/runstest.m -***** test - data = [-213 -564 -35 -15 141 115 -420 -360 203 -338 -431 194 -220 -513 154 -125 -559 92 -21 -579 -52 99 -543 -175 162 -457 -346 204 -300 -474 164 -107 -572 -8 83 -541 -224 180 -420 -374 201 -236 -531 83 27 -564 -112 131 -507 -254 199 -311 -495 143 -46 -579 -90 136 -472 -338 202 -287 -477 169 -124 -568 17 48 -568 -135 162 -430 -422 172 -74 -577 -13 92 -534 -243 194 -355 -465 156 -81 -578 -64 139 -449 -384 193 -198 -538 110 -44 -577 -6 66 -552 -164 161 -460 -344 205 -281 -504 134 -28 -576 -118 156 -437 -381 200 -220 -540 83 11 -568 -160 172 -414 -408 188 -125 -572 -32 139 -492 -321 205 -262 -504 142 -83 -574 0 48 -571 -106 137 -501 -266 190 -391 -406 194 -186 -553 83 -13 -577 -49 103 -515 -280 201 300 -506 131 -45 -578 -80 138 -462 -361 201 -211 -554 32 74 -533 -235 187 -372 -442 182 -147 -566 25 68 -535 -244 194 -351 -463 174 -125 -570 15 72 -550 -190 172 -424 -385 198 -218 -536 96]; #NIST beam deflection data, http://www.itl.nist.gov/div898/handbook/eda/section4/eda425.htm - [h, p, stats] = runstest (data); - expected_h = true; - expected_p = 0.0070646; - expected_z = 2.6938; - assert (h, expected_h); - assert (p, expected_p, 1E-6); - assert (stats.z, expected_z, 1E-4); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/betastat.m] ->>>>> /build/octave-statistics-1.4.2/inst/betastat.m -***** test - a = -2:6; - b = 0.4:0.2:2; - [m, v] = betastat (a, b); - expected_m = [NaN NaN NaN 1/2 2/3.2 3/4.4 4/5.6 5/6.8 6/8]; - expected_v = [NaN NaN NaN 0.0833, 0.0558, 0.0402, 0.0309, 0.0250, 0.0208]; - assert (m, expected_m, eps*100); - assert (v, expected_v, 0.001); -***** test - a = -2:1:6; - [m, v] = betastat (a, 1.5); - expected_m = [NaN NaN NaN 1/2.5 2/3.5 3/4.5 4/5.5 5/6.5 6/7.5]; - expected_v = [NaN NaN NaN 0.0686, 0.0544, 0.0404, 0.0305, 0.0237, 0.0188]; - assert (m, expected_m); - assert (v, expected_v, 0.001); -***** test - a = [14 Inf 10 NaN 10]; - b = [12 9 NaN Inf 12]; - [m, v] = betastat (a, b); - expected_m = [14/26 NaN NaN NaN 10/22]; - expected_v = [168/18252 NaN NaN NaN 120/11132]; - assert (m, expected_m); - assert (v, expected_v); -***** assert (nthargout (1:2, @betastat, 5, []), {[], []}) -***** assert (nthargout (1:2, @betastat, [], 5), {[], []}) -***** assert (nthargout (1:2, @betastat, "", 5), {[], []}) -***** assert (nthargout (1:2, @betastat, true, 5), {1/6, 5/252}) -***** assert (size (betastat (rand (10, 5, 4), rand (10, 5, 4))), [10 5 4]) -***** assert (size (betastat (rand (10, 5, 4), 7)), [10 5 4]) -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/nakacdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/nakacdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 0.63212055882855778, 0.98168436111126578, 1]; -***** assert (nakacdf (x, ones (1,5), ones (1,5)), y, eps) -***** assert (nakacdf (x, 1, 1), y, eps) -***** assert (nakacdf (x, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)]) -***** assert (nakacdf (x, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)]) -***** assert (nakacdf ([x, NaN], 1, 1), [y, NaN], eps) -***** assert (nakacdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps('single')) -***** assert (nakacdf ([x, NaN], single (1), 1), single ([y, NaN]), eps('single')) -***** assert (nakacdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps('single')) -***** error nakacdf () -***** error nakacdf (1) -***** error nakacdf (1,2) -***** error nakacdf (1,2,3,4) -***** error nakacdf (ones (3), ones (2), ones(2)) -***** error nakacdf (ones (2), ones (3), ones(2)) -***** error nakacdf (ones (2), ones (2), ones(3)) -***** error nakacdf (i, 2, 2) -***** error nakacdf (2, i, 2) -***** error nakacdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/nbinstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/nbinstat.m -***** test - n = 1:4; - p = 0.2:0.2:0.8; - [m, v] = nbinstat (n, p); - expected_m = [ 4.0000, 3.0000, 2.0000, 1.0000]; - expected_v = [20.0000, 7.5000, 3.3333, 1.2500]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -***** test - n = 1:4; - [m, v] = nbinstat (n, 0.5); - expected_m = [1, 2, 3, 4]; - expected_v = [2, 4, 6, 8]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/combnk.m] ->>>>> /build/octave-statistics-1.4.2/inst/combnk.m -***** demo - c = combnk (1:5, 2); - disp ("All pairs of integers between 1 and 5:"); - disp (c); -***** test - c = combnk (1:3, 2); - assert (c, [1, 2; 1, 3; 2, 3]); -***** test - c = combnk (1:3, 6); - assert (isempty (c)); -***** test - c = combnk ({1, 2, 3}, 2); - assert (c, {1, 2; 1, 3; 2, 3}); -***** test - c = combnk ("hello", 2); - assert (c, ["lo"; "lo"; "ll"; "eo"; "el"; "el"; "ho"; "hl"; "hl"; "he"]); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/wblstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/wblstat.m -***** test - scale = 3:8; - shape = 1:6; - [m, v] = wblstat (scale, shape); - expected_m = [3.0000, 3.5449, 4.4649, 5.4384, 6.4272, 7.4218]; - expected_v = [9.0000, 3.4336, 2.6333, 2.3278, 2.1673, 2.0682]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); +[inst/gevlike.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevlike.m ***** test - shape = 1:6; - [m, v] = wblstat (6, shape); - expected_m = [ 6.0000, 5.3174, 5.3579, 5.4384, 5.5090, 5.5663]; - expected_v = [36.0000, 7.7257, 3.7920, 2.3278, 1.5923, 1.1634]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gamfit.m] ->>>>> /build/octave-statistics-1.4.2/inst/gamfit.m -***** shared v, res - v = [1.2 1.6 1.7 1.8 1.9 2.0 2.2 2.6 3.0 3.5 4.0 4.8 5.6 6.6 7.6]; - res = gamfit(v); -***** assert (res(1), 3.425, 1E-3); -***** assert (res(2), 0.975, 1E-3); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gevinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevinv.m + x = 1; + k = 0.2; + sigma = 0.3; + mu = 0.5; + [L, D, C] = gevlike ([k sigma mu], x); + expected_L = 0.75942; + expected_D = [0.53150; -0.67790; -2.40674]; + expected_C = [-0.12547 1.77884 1.06731; 1.77884 16.40761 8.48877; 1.06731 8.48877 0.27979]; + assert (L, expected_L, 0.001); + assert (D, expected_D, 0.001); + assert (C, expected_C, 0.001); ***** test - p = 0.1:0.1:0.9; + x = 1; k = 0; - sigma = 1; - mu = 0; - x = gevinv (p, k, sigma, mu); - c = gevcdf(x, k, sigma, mu); - assert (c, p, 0.001); -***** test - p = 0.1:0.1:0.9; - k = 1; - sigma = 1; - mu = 0; - x = gevinv (p, k, sigma, mu); - c = gevcdf(x, k, sigma, mu); - assert (c, p, 0.001); + sigma = 0.3; + mu = 0.5; + [L, D, C] = gevlike ([k sigma mu], x); + expected_L = 0.65157; + expected_D = [0.54011; -1.17291; -2.70375]; + expected_C = [0.090036 3.41229 2.047337; 3.412229 24.760027 12.510190; 2.047337 12.510190 2.098618]; + assert (L, expected_L, 0.001); + assert (D, expected_D, 0.001); + assert (C, expected_C, 0.001); ***** test - p = 0.1:0.1:0.9; - k = 0.3; - sigma = 1; - mu = 0; - x = gevinv (p, k, sigma, mu); - c = gevcdf(x, k, sigma, mu); - assert (c, p, 0.001); + x = -5:-1; + k = -0.2; + sigma = 0.3; + mu = 0.5; + [L, D, C] = gevlike ([k sigma mu], x); + expected_L = 3786.4; + expected_D = [6.4511e+04; -4.8194e+04; 3.0633e+03]; + expected_C = -[-1.4937e+06 1.0083e+06 -6.1837e+04; 1.0083e+06 -8.1138e+05 4.0917e+04; -6.1837e+04 4.0917e+04 -2.0422e+03]; + assert (L, expected_L, -0.001); + assert (D, expected_D, -0.001); + assert (C, expected_C, -0.001); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/jackknife.m] ->>>>> /build/octave-statistics-1.4.2/inst/jackknife.m -***** test - ##Example from Quenouille, Table 1 - d=[0.18 4.00 1.04 0.85 2.14 1.01 3.01 2.33 1.57 2.19]; - jackstat = jackknife ( @(x) 1/mean(x), d ); - assert ( 10 / mean(d) - 9 * mean(jackstat), 0.5240, 1e-5 ); -***** demo - for k = 1:1000 - x=rand(10,1); - s(k)=std(x); - jackstat=jackknife(@std,x); - j(k)=10*std(x) - 9*mean(jackstat); - end - figure();hist([s',j'], 0:sqrt(1/12)/10:2*sqrt(1/12)) -***** demo - for k = 1:1000 - x=randn(1,50); - y=rand(1,50); - jackstat=jackknife(@(x) std(x{1})/std(x{2}),y,x); - j(k)=50*std(y)/std(x) - 49*mean(jackstat); - v(k)=sumsq((50*std(y)/std(x) - 49*jackstat) - j(k)) / (50 * 49); - end - t=(j-sqrt(1/12))./sqrt(v); - figure();plot(sort(tcdf(t,49)),"-;Almost linear mapping indicates good fit with t-distribution.;") -1 test, 1 passed, 0 known failure, 0 skipped -[inst/unidstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/unidstat.m -***** test - n = 1:6; - [m, v] = unidstat (n); - expected_m = [1.0000, 1.5000, 2.0000, 2.5000, 3.0000, 3.5000]; - expected_v = [0.0000, 0.2500, 0.6667, 1.2500, 2.0000, 2.9167]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/pdf.m -***** test - assert(pdf ('norm', 1, 0, 1), normpdf (1, 0, 1)) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/gmdistribution.m] ->>>>> /build/octave-statistics-1.4.2/inst/gmdistribution.m -***** test - mu = eye(2); - Sigma = eye(2); - GM = gmdistribution (mu, Sigma); - density = GM.pdf ([0 0; 1 1]); - assert (density(1) - density(2), 0, 1e-6); - - [idx, nlogl, P, logpdf,M] = cluster (GM, eye(2)); - assert (idx, [1; 2]); - [idx2,nlogl2,P2,logpdf2] = GM.cluster (eye(2)); - assert (nlogl - nlogl2, 0, 1e-6); - [idx3,nlogl3,P3] = cluster (GM, eye(2)); - assert (P - P3, zeros (2), 1e-6); - [idx4,nlogl4] = cluster (GM, eye(2)); - assert (size (nlogl4), [1 1]); - idx5 = cluster (GM, eye(2)); - assert (idx - idx5, zeros (2,1)); - - D = GM.mahal ([1;0]); - assert (D - M(1,:), zeros (1,2), 1e-6); - - P = GM.posterior ([0 1]); - assert (P - P2(2,:), zeros (1,2), 1e-6); - - R = GM.random(20); - assert (size(R), [20, 2]); - - R = GM.random(); - assert (size(R), [1, 2]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/burrcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/burrcdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 1/2, 2/3, 1]; -***** assert (burrcdf (x, ones(1,5), ones (1,5), ones (1,5)), y, eps) -***** assert (burrcdf (x, 1, 1, 1), y, eps) -***** assert (burrcdf (x, [1, 1, NaN, 1, 1], 1, 1), [y(1:2), NaN, y(4:5)], eps) -***** assert (burrcdf (x, 1, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) -***** assert (burrcdf (x, 1, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) -***** assert (burrcdf ([x, NaN], 1, 1, 1), [y, NaN], eps) -***** assert (burrcdf (single ([x, NaN]), 1, 1, 1), single ([y, NaN]), eps('single')) -***** assert (burrcdf ([x, NaN], single (1), 1, 1), single ([y, NaN]), eps('single')) -***** assert (burrcdf ([x, NaN], 1, single (1), 1), single ([y, NaN]), eps('single')) -***** assert (burrcdf ([x, NaN], 1, 1, single (1)), single ([y, NaN]), eps('single')) -***** error burrcdf () -***** error burrcdf (1) -***** error burrcdf (1,2) -***** error burrcdf (1,2,3) -***** error burrcdf (1,2,3,4,5) -***** error burrcdf (ones (3), ones (2), ones(2), ones(2)) -***** error burrcdf (ones (2), ones (3), ones(2), ones(2)) -***** error burrcdf (ones (2), ones (2), ones(3), ones(2)) -***** error burrcdf (ones (2), ones (2), ones(2), ones(3)) -***** error burrcdf (i, 2, 2, 2) -***** error burrcdf (2, i, 2, 2) -***** error burrcdf (2, 2, i, 2) -***** error burrcdf (2, 2, 2, i) -23 tests, 23 passed, 0 known failure, 0 skipped +[inst/gppdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/gppdf.m +***** shared x,y1,y2,y3 + x = [-Inf, -1, 0, 1/2, 1, Inf]; + y1 = [0, 0, 1, 0.6065306597126334, 0.36787944117144233, 0]; + y2 = [0, 0, 1, 4/9, 1/4, 0]; + y3 = [0, 0, 1, 1, 1, 0]; +***** assert (gppdf (x, zeros (1,6), ones (1,6), zeros (1,6)), y1, eps) +***** assert (gppdf (x, 0, 1, zeros (1,6)), y1, eps) +***** assert (gppdf (x, 0, ones (1,6), 0), y1, eps) +***** assert (gppdf (x, zeros (1,6), 1, 0), y1, eps) +***** assert (gppdf (x, 0, 1, 0), y1, eps) +***** assert (gppdf (x, 0, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y1(5:6)]) +***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y1(5:6)]) +***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 0), [y1(1:3), NaN, y1(5:6)]) +***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, 0), [y1(1:3), NaN, y1(5:6)]) +***** assert (gppdf (x, ones (1,6), ones (1,6), zeros (1,6)), y2, eps) +***** assert (gppdf (x, 1, 1, zeros (1,6)), y2, eps) +***** assert (gppdf (x, 1, ones (1,6), 0), y2, eps) +***** assert (gppdf (x, ones (1,6), 1, 0), y2, eps) +***** assert (gppdf (x, 1, 1, 0), y2, eps) +***** assert (gppdf (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf ([x(1:3), NaN, x(5:6)], 1, 1, 0), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, -ones (1,6), ones (1,6), zeros (1,6)), y3, eps) +***** assert (gppdf (x, -1, 1, zeros (1,6)), y3, eps) +***** assert (gppdf (x, -1, ones (1,6), 0), y3, eps) +***** assert (gppdf (x, -ones (1,6), 1, 0), y3, eps) +***** assert (gppdf (x, -1, 1, 0), y3, eps) +***** assert (gppdf (x, -1, 1, [0, 0, 0, NaN, 0, 0]), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (x, -1, [1, 1, 1, NaN, 1, 1], 0), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (x, [-1, -1, -1, NaN, -1, -1], 1, 0), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf ([x(1:3), NaN, x(5:6)], -1, 1, 0), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], 0, single (1), 0), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], single (0), 1, 0), single ([y1, NaN])) +***** assert (gppdf (single ([x, NaN]), 1, 1, 0), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], 1, 1, single (0)), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], 1, single (1), 0), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], single (1), 1, 0), single ([y2, NaN])) +***** assert (gppdf (single ([x, NaN]), -1, 1, 0), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], -1, 1, single (0)), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], -1, single (1), 0), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], single (-1), 1, 0), single ([y3, NaN])) +***** error gppdf () +***** error gppdf (1) +***** error gppdf (1,2) +***** error gppdf (1,2,3) +***** error gppdf (1,2,3,4,5) +***** error gppdf (1, ones (2), ones (2), ones (3)) +***** error gppdf (1, ones (2), ones (3), ones (2)) +***** error gppdf (1, ones (3), ones (2), ones (2)) +***** error gppdf (i, 2, 2, 2) +***** error gppdf (2, i, 2, 2) +***** error gppdf (2, 2, i, 2) +***** error gppdf (2, 2, 2, i) +51 tests, 51 passed, 0 known failure, 0 skipped +[inst/bbsinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/bbsinv.m +***** shared x,y,f + f = @(x,a,b,c) (a + b * (c * norminv (x) + sqrt (4 + (c * norminv(x))^2))^2) / 4; + x = [-1, 0, 1/4, 1/2, 1, 2]; + y = [0, 0, f(1/4, 0, 1, 1), 1, Inf, NaN]; +***** assert (bbsinv (x, ones (1,6), ones (1,6), zeros (1,6)), y) +***** assert (bbsinv (x, 1, 1, zeros (1,6)), y) +***** assert (bbsinv (x, 1, ones (1,6), 0), y) +***** assert (bbsinv (x, ones (1,6), 1, 0), y) +***** assert (bbsinv (x, 1, 1, 0), y) +***** assert (bbsinv (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv ([x, NaN], 1, 1, 0), [y, NaN]) +***** assert (bbsinv (single ([x, NaN]), 1, 1, 0), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], 1, 1, single (0)), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], 1, single (1), 0), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], single (1), 1, 0), single ([y, NaN])) +***** error bbsinv () +***** error bbsinv (1) +***** error bbsinv (1,2,3) +***** error bbsinv (1,2,3,4,5) +***** error bbsinv (ones (3), ones (2), ones(2), ones(2)) +***** error bbsinv (ones (2), ones (3), ones(2), ones(2)) +***** error bbsinv (ones (2), ones (2), ones(3), ones(2)) +***** error bbsinv (ones (2), ones (2), ones(2), ones(3)) +***** error bbsinv (i, 4, 3, 2) +***** error bbsinv (1, i, 3, 2) +***** error bbsinv (1, 4, i, 2) +***** error bbsinv (1, 4, 3, i) +25 tests, 25 passed, 0 known failure, 0 skipped [inst/tripdf.m] >>>>> /build/octave-statistics-1.4.2/inst/tripdf.m ***** shared x,y,deps @@ -3823,375 +3135,20 @@ plot (centers (:, 1), centers (:, 2), 'kv', 'markersize', 10); hold off; 31 tests, 31 passed, 0 known failure, 0 skipped -[inst/gevstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevstat.m -***** test - k = [-1 -0.5 0 0.2 0.4 0.5 1]; - sigma = 2; - mu = 1; - [m, v] = gevstat (k, sigma, mu); - expected_m = [1 1.4551 2.1544 2.6423 3.4460 4.0898 Inf]; - expected_v = [4 3.4336 6.5797 13.3761 59.3288 Inf Inf]; - assert (m, expected_m, -0.001); - assert (v, expected_v, -0.001); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/iwishpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/iwishpdf.m -***** assert(iwishpdf(4, 3, 3.1), 0.04226595, 1E-7); -***** assert(iwishpdf([2 -0.3;-0.3 4], [1 0.3;0.3 1], 4), 1.60166e-05, 1E-10); -***** assert(iwishpdf([6 2 5; 2 10 -5; 5 -5 25], [9 5 5; 5 10 -8; 5 -8 22], 5.1), 4.946831e-12, 1E-17); -***** error iwishpdf () -***** error iwishpdf (1, 2) -***** error iwishpdf (1, 2, 0) -***** error wishpdf (1, 2) -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/tests/sign_test.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/sign_test.m -***** error sign_test () -***** error sign_test ([]) -***** assert (sign_test (zeros(1,10), ones(1,10)), sign_test (zeros(1,10), ones(1,10), "!=")) -***** assert (sign_test (zeros(1,10), ones(1,10)), sign_test (zeros(1,10), ones(1,10), "<>")) -***** assert (sign_test (ones(1,10), zeros(1,10), '<'), 0) -***** assert (sign_test (ones(1,10), zeros(1,10), '>'), 1) -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/tests/kruskal_wallis_test.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/kruskal_wallis_test.m -***** assert (abs (kruskal_wallis_test ([86 86], [74]) - 0.157299207050285) < 0.0000000000001) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/tests/z_test_2.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/z_test_2.m -***** test - ## Two-sided (also the default option) - x = randn (100, 1); v_x = 2; x = v_x * x; - [pval, zval] = z_test_2 (x, x, v_x, v_x); - zval_exp = 0; pval_exp = 1.0; - assert (zval, zval_exp, eps); - assert (pval, pval_exp, eps); -***** test - ## Two-sided (also the default option) - x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); - y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); - [pval, z] = z_test_2 (x, y, v_x, v_y); - if (mean (x) >= mean (y)) - zval = abs (norminv (0.5*pval)); - else - zval = -abs (norminv (0.5*pval)); - endif - unew = zval * sqrt (v_x/n_x + v_y/n_y); - delmu = mean (x) - mean (y); - assert (delmu, unew, 100*eps); -***** test - x = randn (100, 1); v_x = 2; x = v_x * x; - [pval, zval] = z_test_2 (x, x, v_x, v_x, ">"); - zval_exp = 0; pval_exp = 0.5; - assert (zval, zval_exp, eps); - assert (pval, pval_exp, eps); -***** test - x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); - y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); - [pval, z] = z_test_2 (x, y, v_x, v_y, ">"); - zval = norminv (1-pval); - unew = zval * sqrt (v_x/n_x + v_y/n_y); - delmu = mean (x) - mean (y); - assert (delmu, unew, 100*eps); -***** test - x = randn (100, 1); v_x = 2; x = v_x * x; - [pval, zval] = z_test_2 (x, x, v_x, v_x, "<"); - zval_exp = 0; pval_exp = 0.5; - assert (zval, zval_exp, eps); - assert (pval, pval_exp, eps); -***** test - x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); - y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); - [pval, z] = z_test_2 (x, y, v_x, v_y, "<"); - zval = norminv (pval); - unew = zval * sqrt (v_x/n_x + v_y/n_y); - delmu = mean (x) - mean (y); - assert (delmu, unew, 100*eps); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/tests/z_test.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/z_test.m -***** test - ## Two-sided (also the default option) - x = rand (10,1); n = length (x); - u0 = 0.5; v = 1/12; # true mean, var - pval = z_test (x, u0, v, "!="); - if (mean (x) >= u0) - zval = abs (norminv (0.5*pval)); - else - zval = -abs (norminv (0.5*pval)); - endif - unew = zval * sqrt (v/n) + u0; - assert (mean (x), unew, 100*eps); -***** test - x = rand (10,1); n = length (x); - u0 = 0.5; v = 1/12; - pval = z_test (x, u0, v, ">"); - zval = norminv (1-pval); - unew = zval * sqrt (v/n) + u0; - assert (mean (x), unew, 100*eps); -***** test - x = rand (10,1); n = length (x); - u0 = 0.5; v = 1/12; - pval = z_test (x, u0, v, "<"); - zval = norminv (pval); - unew = zval * sqrt (v/n) + u0; - assert (mean (x), unew, 100*eps); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/tests/t_test.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/t_test.m -***** xtest - ## Two-sided (also the default option) - x = rand (10,1); n = length (x); - u0 = 0.5; # true mean - xbar = mean (x); - pval = t_test (x, u0, "!="); - if (xbar >= u0) - tval = abs (tinv (0.5*pval, n-1)); - else - tval = -abs (tinv (0.5*pval, n-1)); - endif - unew = tval * std(x)/sqrt(n) + u0; - assert (xbar, unew, 1e6*eps); -***** xtest - x = rand (10,1); n = length (x); - u0 = 0.5; - pval = t_test (x, u0, ">"); - tval = tinv (1-pval, n-1); - unew = tval * std(x)/sqrt(n) + u0; - assert (mean (x), unew, 1e6*eps); -***** xtest - x = rand (10,1); n = length (x); - u0 = 0.5; - pval = t_test (x, u0, "<"); - tval = tinv (pval, n-1); - unew = tval * std(x)/sqrt(n) + u0; - assert (mean (x), unew, 1e6*eps); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/tests/kolmogorov_smirnov_test.m] ->>>>> /build/octave-statistics-1.4.2/inst/tests/kolmogorov_smirnov_test.m -***** assert (kolmogorov_smirnov_test (0:100, "unif", 0, 100), 1.0, eps) -***** assert (kolmogorov_smirnov_test (0:100, "logistic"), 0) -***** assert (kolmogorov_smirnov_test (50:100, "unif", 0, 50, "<")) -***** error kolmogorov_smirnov_test (1) -***** error kolmogorov_smirnov_test ({}, "unif", 2, 4) -***** error - kolmogorov_smirnov_test (1, "not_a_dist"); -***** error - kolmogorov_smirnov_test (1, "unif", 2, 4, "foo"); -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/mvtpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/mvtpdf.m -***** assert (mvtpdf ([0 0], eye(2), 1), 0.1591549, 1E-7) #dmvt(x = c(0,0), sigma = diag(2), log = FALSE) -***** assert (mvtpdf ([1 0], [1 0.5; 0.5 1], 2), 0.06615947, 1E-7) #dmvt(x = c(1,0), sigma = matrix(c(1, 0.5, 0.5, 1), nrow=2, ncol=2), df = 2, log = FALSE) -***** assert (mvtpdf ([1 0.4 0; 1.2 0.5 0.5; 1.4 0.6 1], [1 0.5 0.3; 0.5 1 0.6; 0.3 0.6 1], [5 6 7]), [0.04713313 0.03722421 0.02069011]', 1E-7) #dmvt(x = c(1,0.4,0), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 5, log = FALSE); dmvt(x = c(1.2,0.5,0.5), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 6, log = FALSE); dmvt(x = c(1.4,0.6,1), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 7, log = FALSE) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/crossval.m] ->>>>> /build/octave-statistics-1.4.2/inst/crossval.m -***** test - load fisheriris.txt - y = fisheriris(:, 2); - X = [ones(size(y)) fisheriris(:, 3:5)]; - f = @(X1, y1, X2, y2) meansq (y2 - X2*regress(y1, X1)); - results0 = crossval (f, X, y); - results1 = crossval (f, X, y, 'KFold', 10); - folds = 5; - results2 = crossval (f, X, y, 'KFold', folds); - results3 = crossval (f, X, y, 'Partition', cvpartition (numel (y), 'KFold', folds)); - results4 = crossval (f, X, y, 'LeaveOut', 1); - mcreps = 2; n_holdout = 20; - results5 = crossval (f, X, y, 'HoldOut', n_holdout, 'mcreps', mcreps); - - ## ensure equal representation of iris species in the training set -- tends - ## to slightly reduce cross-validation mean square error - results6 = crossval (f, X, y, 'KFold', 5, 'stratify', fisheriris(:, 1)); - - assert (results0, results1); - assert (results2, results3); - assert (size(results4), [1 numel(y)]); - assert (mean(results4), 4.5304, 1E-4); - assert (size(results5), [mcreps 1]); -warning: load: '/build/octave-statistics-1.4.2/debian/octave-statistics/usr/share/octave/packages/statistics-1.4.2/fisheriris.txt' found by searching load path -warning: called from - __test__ at line 3 column 2 - test at line 677 column 11 - /tmp/tmp.8RcEwdXUFp at line 422 column 31 - -warning: strmatch is obsolete; use strncmp or strcmp instead -1 test, 1 passed, 0 known failure, 0 skipped -[inst/poisstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/poisstat.m -***** test - lambda = 1 ./ (1:6); - [m, v] = poisstat (lambda); - assert (m, lambda); - assert (v, lambda); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/trirnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/trirnd.m -***** assert (size (trirnd (1,2,1.5)), [1, 1]) -***** assert (size (trirnd (1*ones (2,1), 2,1.5)), [2, 1]) -***** assert (size (trirnd (1*ones (2,2), 2,1.5)), [2, 2]) -***** assert (size (trirnd (1, 2*ones (2,1), 1.5)), [2, 1]) -***** assert (size (trirnd (1, 2*ones (2,2), 1.5)), [2, 2]) -***** assert (size (trirnd (1, 2, 1.5*ones (2,1))), [2, 1]) -***** assert (size (trirnd (1, 2, 1.5*ones (2,2))), [2, 2]) -***** assert (size (trirnd (1, 2, 1.5, 3)), [3, 3]) -***** assert (size (trirnd (1, 2, 1.5, [4 1])), [4, 1]) -***** assert (size (trirnd (1, 2, 1.5, 4, 1)), [4, 1]) -***** assert (class (trirnd (1,2,1.5)), "double") -***** assert (class (trirnd (single (1),2,1.5)), "single") -***** assert (class (trirnd (single ([1 1]),2,1.5)), "single") -***** assert (class (trirnd (1,single (2),1.5)), "single") -***** assert (class (trirnd (1,single ([2 2]),1.5)), "single") -***** assert (class (trirnd (1,2,single (1.5))), "single") -***** assert (class (trirnd (1,2,single ([1.5 1.5]))), "single") -***** error trirnd () -***** error trirnd (1) -***** error trirnd (1,2) -***** error trirnd (ones (3), 2*ones (2), 1.5*ones (2), 2) -***** error trirnd (ones (2), 2*ones (3), 1.5*ones (2), 2) -***** error trirnd (ones (2), 2*ones (2), 1.5*ones (3), 2) -***** error trirnd (i, 2, 1.5) -***** error trirnd (1, i, 1.5) -***** error trirnd (1, 2, i) -***** error trirnd (1,2,1.5, -1) -***** error trirnd (1,2,1.5, ones (2)) -***** error trirnd (1,2,1.5, [2 -1 2]) -***** error trirnd (1*ones (2),2,1.5, 3) -***** error trirnd (1*ones (2),2,1.5, [3, 2]) -***** error trirnd (1*ones (2),2,1.5, 3, 2) -32 tests, 32 passed, 0 known failure, 0 skipped -[inst/canoncorr.m] ->>>>> /build/octave-statistics-1.4.2/inst/canoncorr.m -***** shared X,Y,A,B,r,U,V,k - k = 10; - X = [1:k; sin(1:k); cos(1:k)]'; Y = [tan(1:k); tanh((1:k)/k)]'; - [A,B,r,U,V,stats] = canoncorr (X,Y); -***** assert (A, [-0.329229 0.072908; 0.074870 1.389318; -0.069302 -0.024109], 1E-6); -***** assert (B, [-0.017086 -0.398402; -4.475049 -0.824538], 1E-6); -***** assert (r, [0.99590 0.26754], 1E-5); -***** assert (U, center(X) * A, 10*eps); -***** assert (V, center(Y) * B, 10*eps); -***** assert (cov(U), eye(size(U, 2)), 10*eps); -***** assert (cov(V), eye(size(V, 2)), 10*eps); - rand ("state", 1); [A,B,r] = canoncorr (rand(5, 10),rand(5, 20)); -***** assert (r, ones(1, 5), 10*eps); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/expstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/expstat.m -***** test - l = 1:6; - [m, v] = expstat (l); - assert (m, [1, 2, 3, 4, 5, 6], 0.001); - assert (v, [1, 4, 9, 16, 25, 36], 0.001); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/copularnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/copularnd.m -***** test - theta = 0.5; - x = copularnd ("Gaussian", theta); - assert (size (x), [1, 2]); - assert (all ((x >= 0) & (x <= 1))); -***** test - theta = 0.5; - nu = 2; - x = copularnd ("t", theta, nu); - assert (size (x), [1, 2]); - assert (all ((x >= 0) & (x <= 1))); -***** test - theta = 0.5; - x = copularnd ("Clayton", theta); - assert (size (x), [1, 2]); - assert (all ((x >= 0) & (x <= 1))); -***** test - theta = 0.5; - n = 2; - x = copularnd ("Clayton", theta, n); - assert (size (x), [n, 2]); - assert (all ((x >= 0) & (x <= 1))); -***** test - theta = [1; 2]; - n = 2; - d = 3; - x = copularnd ("Clayton", theta, n, d); - assert (size (x), [n, d]); - assert (all ((x >= 0) & (x <= 1))); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/hygestat.m] ->>>>> /build/octave-statistics-1.4.2/inst/hygestat.m -***** test - t = 4:9; - m = 0:5; - n = 1:6; - [mn, v] = hygestat (t, m, n); - expected_mn = [0.0000, 0.4000, 1.0000, 1.7143, 2.5000, 3.3333]; - expected_v = [0.0000, 0.2400, 0.4000, 0.4898, 0.5357, 0.5556]; - assert (mn, expected_mn, 0.001); - assert (v, expected_v, 0.001); -***** test - t = 4:9; - m = 0:5; - [mn, v] = hygestat (t, m, 2); - expected_mn = [0.0000, 0.4000, 0.6667, 0.8571, 1.0000, 1.1111]; - expected_v = [0.0000, 0.2400, 0.3556, 0.4082, 0.4286, 0.4321]; - assert (mn, expected_mn, 0.001); - assert (v, expected_v, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/tblread.m] ->>>>> /build/octave-statistics-1.4.2/inst/tblread.m -***** shared d, v, c, tblreadspacefile, tblreadtabfile - d = [1 2;3 4]; - v = ["a ";"bc"]; - c = ["de";"f "]; - tblreadspacefile = file_in_loadpath("test/tblread-space.dat"); - tblreadtabfile = file_in_loadpath("test/tblread-tab.dat"); -***** test - [dt vt ct] = tblread (tblreadspacefile); - assert (dt, d); - assert (vt, v); - assert (ct, c); -***** test - [dt vt ct] = tblread (tblreadspacefile, " "); - assert (dt, d); - assert (vt, v); - assert (ct, c); -***** test - [dt vt ct] = tblread (tblreadspacefile, "space"); - assert (dt, d); - assert (vt, v); - assert (ct, c); -***** test - [dt vt ct] = tblread (tblreadtabfile, "tab"); - assert (dt, d); - assert (vt, v); - assert (ct, c); +[inst/raylcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/raylcdf.m ***** test - [dt vt ct] = tblread (tblreadtabfile, "\t"); - assert (dt, d); - assert (vt, v); - assert (ct, c); + x = 0:0.5:2.5; + sigma = 1:6; + p = raylcdf (x, sigma); + expected_p = [0.0000, 0.0308, 0.0540, 0.0679, 0.0769, 0.0831]; + assert (p, expected_p, 0.001); ***** test - [dt vt ct] = tblread (tblreadtabfile, '\t'); - assert (dt, d); - assert (vt, v); - assert (ct, c); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/cmdscale.m] ->>>>> /build/octave-statistics-1.4.2/inst/cmdscale.m -***** shared m, n, X, D - m = randi(100) + 1; n = randi(100) + 1; X = rand(m, n); D = pdist(X); -***** assert(norm(pdist(cmdscale(D))), norm(D), sqrt(eps)) -***** assert(norm(pdist(cmdscale(squareform(D)))), norm(D), sqrt(eps)) + x = 0:0.5:2.5; + p = raylcdf (x, 0.5); + expected_p = [0.0000, 0.3935, 0.8647, 0.9889, 0.9997, 1.0000]; + assert (p, expected_p, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gevfit_lmom.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevfit_lmom.m -***** xtest <31070> - data = 1:50; - [pfit, pci] = gevfit_lmom (data); - expected_p = [-0.28 15.01 20.22]'; - assert (pfit, expected_p, 0.1); -1 test, 1 passed, 0 known failure, 0 skipped [inst/copulacdf.m] >>>>> /build/octave-statistics-1.4.2/inst/copulacdf.m ***** test @@ -4224,44 +3181,178 @@ expected_p = [0.0558; 0.0293]; assert (p, expected_p, 0.001); 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/geostat.m] ->>>>> /build/octave-statistics-1.4.2/inst/geostat.m +[inst/gevstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevstat.m ***** test - p = 1 ./ (1:6); - [m, v] = geostat (p); - assert (m, [0, 1, 2, 3, 4, 5], 0.001); - assert (v, [0, 2, 6, 12, 20, 30], 0.001); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/nanvar.m] ->>>>> /build/octave-statistics-1.4.2/inst/nanvar.m -***** shared x - x = [1 2 nan 3 4 5]; -***** assert (nanvar (x), var (x(! isnan (x))), 10*eps) + k = [-1 -0.5 0 0.2 0.4 0.5 1]; + sigma = 2; + mu = 1; + [m, v] = gevstat (k, sigma, mu); + expected_m = [1 1.4551 2.1544 2.6423 3.4460 4.0898 Inf]; + expected_v = [4 3.4336 6.5797 13.3761 59.3288 Inf Inf]; + assert (m, expected_m, -0.001); + assert (v, expected_v, -0.001); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/nakapdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/nakapdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 0.73575888234288467, 0.073262555554936715, 0]; -***** assert (nakapdf (x, ones (1,5), ones (1,5)), y, eps) -***** assert (nakapdf (x, 1, 1), y, eps) -***** assert (nakapdf (x, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) -***** assert (nakapdf (x, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) -***** assert (nakapdf ([x, NaN], 1, 1), [y, NaN], eps) -***** assert (nakapdf (single ([x, NaN]), 1, 1), single ([y, NaN])) -***** assert (nakapdf ([x, NaN], single (1), 1), single ([y, NaN])) -***** assert (nakapdf ([x, NaN], 1, single (1)), single ([y, NaN])) -***** error nakapdf () -***** error nakapdf (1) -***** error nakapdf (1,2) -***** error nakapdf (1,2,3,4) -***** error nakapdf (ones (3), ones (2), ones(2)) -***** error nakapdf (ones (2), ones (3), ones(2)) -***** error nakapdf (ones (2), ones (2), ones(3)) -***** error nakapdf (i, 2, 2) -***** error nakapdf (2, i, 2) -***** error nakapdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped +[inst/unifstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/unifstat.m +***** test + a = 1:6; + b = 2:2:12; + [m, v] = unifstat (a, b); + expected_m = [1.5000, 3.0000, 4.5000, 6.0000, 7.5000, 9.0000]; + expected_v = [0.0833, 0.3333, 0.7500, 1.3333, 2.0833, 3.0000]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +***** test + a = 1:6; + [m, v] = unifstat (a, 10); + expected_m = [5.5000, 6.0000, 6.5000, 7.0000, 7.5000, 8.0000]; + expected_v = [6.7500, 5.3333, 4.0833, 3.0000, 2.0833, 1.3333]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/gprnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/gprnd.m +***** assert (size (gprnd (0,1,0)), [1, 1]) +***** assert (size (gprnd (0, 1, zeros (2,1))), [2, 1]) +***** assert (size (gprnd (0, 1, zeros (2,2))), [2, 2]) +***** assert (size (gprnd (0, ones (2,1), 0)), [2, 1]) +***** assert (size (gprnd (0, ones (2,2), 0)), [2, 2]) +***** assert (size (gprnd (zeros (2,1), 1, 0)), [2, 1]) +***** assert (size (gprnd (zeros (2,2), 1, 0)), [2, 2]) +***** assert (size (gprnd (0, 1, 0, 3)), [3, 3]) +***** assert (size (gprnd (0, 1, 0, [4 1])), [4, 1]) +***** assert (size (gprnd (0, 1, 0, 4, 1)), [4, 1]) +***** assert (size (gprnd (1,1,0)), [1, 1]) +***** assert (size (gprnd (1, 1, zeros (2,1))), [2, 1]) +***** assert (size (gprnd (1, 1, zeros (2,2))), [2, 2]) +***** assert (size (gprnd (1, ones (2,1), 0)), [2, 1]) +***** assert (size (gprnd (1, ones (2,2), 0)), [2, 2]) +***** assert (size (gprnd (ones (2,1), 1, 0)), [2, 1]) +***** assert (size (gprnd (ones (2,2), 1, 0)), [2, 2]) +***** assert (size (gprnd (1, 1, 0, 3)), [3, 3]) +***** assert (size (gprnd (1, 1, 0, [4 1])), [4, 1]) +***** assert (size (gprnd (1, 1, 0, 4, 1)), [4, 1]) +***** assert (size (gprnd (-1, 1, 0)), [1, 1]) +***** assert (size (gprnd (-1, 1, zeros (2,1))), [2, 1]) +***** assert (size (gprnd (1, -1, zeros (2,2))), [2, 2]) +***** assert (size (gprnd (-1, ones (2,1), 0)), [2, 1]) +***** assert (size (gprnd (-1, ones (2,2), 0)), [2, 2]) +***** assert (size (gprnd (-ones (2,1), 1, 0)), [2, 1]) +***** assert (size (gprnd (-ones (2,2), 1, 0)), [2, 2]) +***** assert (size (gprnd (-1, 1, 0, 3)), [3, 3]) +***** assert (size (gprnd (-1, 1, 0, [4 1])), [4, 1]) +***** assert (size (gprnd (-1, 1, 0, 4, 1)), [4, 1]) +***** assert (class (gprnd (0,1,0)), "double") +***** assert (class (gprnd (0, 1, single (0))), "single") +***** assert (class (gprnd (0, 1, single ([0 0]))), "single") +***** assert (class (gprnd (0,single (1),0)), "single") +***** assert (class (gprnd (0,single ([1 1]),0)), "single") +***** assert (class (gprnd (single (0), 1, 0)), "single") +***** assert (class (gprnd (single ([0 0]), 1, 0)), "single") +***** error gprnd () +***** error gprnd (1) +***** error gprnd (1,2) +***** error gprnd (zeros (2), ones (2), zeros (3)) +***** error gprnd (zeros (2), ones (3), zeros (2)) +***** error gprnd (zeros (3), ones (2), zeros (2)) +***** error gprnd (i, 1, 0) +***** error gprnd (0, i, 0) +***** error gprnd (0, 1, i) +***** error gprnd (0,1,0, -1) +***** error gprnd (0,1,0, ones (2)) +***** error gprnd (0,1,0, [2 -1 2]) +***** error gprnd (0,1, zeros (2), 3) +***** error gprnd (0,1, zeros (2), [3, 2]) +***** error gprnd (0,1, zeros (2), 3, 2) +52 tests, 52 passed, 0 known failure, 0 skipped +[inst/canoncorr.m] +>>>>> /build/octave-statistics-1.4.2/inst/canoncorr.m +***** shared X,Y,A,B,r,U,V,k + k = 10; + X = [1:k; sin(1:k); cos(1:k)]'; Y = [tan(1:k); tanh((1:k)/k)]'; + [A,B,r,U,V,stats] = canoncorr (X,Y); +***** assert (A, [-0.329229 0.072908; 0.074870 1.389318; -0.069302 -0.024109], 1E-6); +***** assert (B, [-0.017086 -0.398402; -4.475049 -0.824538], 1E-6); +***** assert (r, [0.99590 0.26754], 1E-5); +***** assert (U, center(X) * A, 10*eps); +***** assert (V, center(Y) * B, 10*eps); +***** assert (cov(U), eye(size(U, 2)), 10*eps); +***** assert (cov(V), eye(size(V, 2)), 10*eps); + rand ("state", 1); [A,B,r] = canoncorr (rand(5, 10),rand(5, 20)); +***** assert (r, ones(1, 5), 10*eps); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/wishrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/wishrnd.m +***** assert(size (wishrnd (1,2)), [1, 1]); +***** assert(size (wishrnd (1,2,[])), [1, 1]); +***** assert(size (wishrnd (1,2,1)), [1, 1]); +***** assert(size (wishrnd ([],2,1)), [1, 1]); +***** assert(size (wishrnd ([3 1; 1 3], 2.00001, [], 1)), [2, 2]); +***** assert(size (wishrnd (eye(2), 2, [], 3)), [2, 2, 3]); +***** error wishrnd () +***** error wishrnd (1) +***** error wishrnd ([1; 1], 2) +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/iwishpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/iwishpdf.m +***** assert(iwishpdf(4, 3, 3.1), 0.04226595, 1E-7); +***** assert(iwishpdf([2 -0.3;-0.3 4], [1 0.3;0.3 1], 4), 1.60166e-05, 1E-10); +***** assert(iwishpdf([6 2 5; 2 10 -5; 5 -5 25], [9 5 5; 5 10 -8; 5 -8 22], 5.1), 4.946831e-12, 1E-17); +***** error iwishpdf () +***** error iwishpdf (1, 2) +***** error iwishpdf (1, 2, 0) +***** error wishpdf (1, 2) +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/sigma_pts.m] +>>>>> /build/octave-statistics-1.4.2/inst/sigma_pts.m +***** demo + K = [1 0.5; 0.5 1]; # covaraince matrix + # calculate and build associated ellipse + [R,S,~] = svd (K); + theta = atan2 (R(2,1), R(1,1)); + v = sqrt (diag (S)); + v = v .* [cos(theta) sin(theta); -sin(theta) cos(theta)]; + t = linspace (0, 2*pi, 100).'; + xe = v(1,1) * cos (t) + v(2,1) * sin (t); + ye = v(1,2) * cos (t) + v(2,2) * sin (t); + + figure(1); clf; hold on + # Plot ellipse and axes + line ([0 0; v(:,1).'],[0 0; v(:,2).']) + plot (xe,ye,'-r'); + + col = 'rgb'; + l = [-1.8 -1 1.5]; + for li = 1:3 + p = sigma_pts (2, [], K, l(li)); + tmp = plot (p(2:end,1), p(2:end,2), ['x' col(li)], ... + p(1,1), p(1,2), ['o' col(li)]); + h(li) = tmp(1); + endfor + hold off + axis image + legend (h, arrayfun (@(x) sprintf ("l:%.2g", x), l, "unif", 0)); +***** test + p = sigma_pts (5); + assert (mean (p), zeros(1,5), sqrt(eps)); + assert (cov (p), eye(5), sqrt(eps)); +***** test + m = randn(1, 5); + p = sigma_pts (5, m); + assert (mean (p), m, sqrt(eps)); + assert (cov (p), eye(5), sqrt(eps)); +***** test + x = linspace (0,1,5); + K = exp (- (x.' - x).^2/ 0.5); + p = sigma_pts (5, [], K); + assert (mean (p), zeros(1,5), sqrt(eps)); + assert (cov (p), K, sqrt(eps)); +***** error sigma_pts(2,1); +***** error sigma_pts(2,[],1); +***** error sigma_pts(2,1,1); +***** error sigma_pts(2,[0.5 0.5],[-1 0; 0 0]); +7 tests, 7 passed, 0 known failure, 0 skipped [inst/grp2idx.m] >>>>> /build/octave-statistics-1.4.2/inst/grp2idx.m ***** test @@ -4373,152 +3464,151 @@ Location | Observed | Expected | Reason [] sa et Strings don't match 10 tests, 7 passed, 0 known failure, 3 skipped -[inst/linkage.m] ->>>>> /build/octave-statistics-1.4.2/inst/linkage.m -***** shared x, t - x = reshape(mod(magic(6),5),[],3); - t = 1e-6; -***** assert (cond (linkage (pdist (x))), 34.119045,t); -***** assert (cond (linkage (pdist (x), "complete")), 21.793345,t); -***** assert (cond (linkage (pdist (x), "average")), 27.045012,t); -***** assert (cond (linkage (pdist (x), "weighted")), 27.412889,t); - lastwarn(); # Clear last warning before the test -***** warning linkage (pdist (x), "centroid"); -***** test warning off clustering - assert (cond (linkage (pdist (x), "centroid")), 27.457477,t); - warning on clustering -warning: clustering -warning: called from - linkage at line 169 column 5 - __test__ at line 3 column 2 - test at line 677 column 11 - /tmp/tmp.8RcEwdXUFp at line 542 column 31 +[inst/gevpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevpdf.m +***** test + x = 0:0.5:2.5; + sigma = 1:6; + k = 1; + mu = 0; + y = gevpdf (x, k, sigma, mu); + expected_y = [0.367879 0.143785 0.088569 0.063898 0.049953 0.040997]; + assert (y, expected_y, 0.001); +***** test + x = -0.5:0.5:2.5; + sigma = 0.5; + k = 1; + mu = 0; + y = gevpdf (x, k, sigma, mu); + expected_y = [0 0.735759 0.303265 0.159229 0.097350 0.065498 0.047027]; + assert (y, expected_y, 0.001); +***** test #check for continuity for k near 0 + x = 1; + sigma = 0.5; + k = -0.03:0.01:0.03; + mu = 0; + y = gevpdf (x, k, sigma, mu); + expected_y = [0.23820 0.23764 0.23704 0.23641 0.23576 0.23508 0.23438]; + assert (y, expected_y, 0.001); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/crossval.m] +>>>>> /build/octave-statistics-1.4.2/inst/crossval.m +***** test + load fisheriris.txt + y = fisheriris(:, 2); + X = [ones(size(y)) fisheriris(:, 3:5)]; + f = @(X1, y1, X2, y2) meansq (y2 - X2*regress(y1, X1)); + results0 = crossval (f, X, y); + results1 = crossval (f, X, y, 'KFold', 10); + folds = 5; + results2 = crossval (f, X, y, 'KFold', folds); + results3 = crossval (f, X, y, 'Partition', cvpartition (numel (y), 'KFold', folds)); + results4 = crossval (f, X, y, 'LeaveOut', 1); + mcreps = 2; n_holdout = 20; + results5 = crossval (f, X, y, 'HoldOut', n_holdout, 'mcreps', mcreps); -***** warning linkage (pdist (x), "median"); -***** test warning off clustering - assert (cond (linkage (pdist (x), "median")), 27.683325,t); - warning on clustering -warning: clustering + ## ensure equal representation of iris species in the training set -- tends + ## to slightly reduce cross-validation mean square error + results6 = crossval (f, X, y, 'KFold', 5, 'stratify', fisheriris(:, 1)); + + assert (results0, results1); + assert (results2, results3); + assert (size(results4), [1 numel(y)]); + assert (mean(results4), 4.5304, 1E-4); + assert (size(results5), [mcreps 1]); +warning: load: '/build/octave-statistics-1.4.2/debian/octave-statistics/usr/share/octave/packages/statistics-1.4.2/fisheriris.txt' found by searching load path warning: called from - linkage at line 169 column 5 __test__ at line 3 column 2 test at line 677 column 11 - /tmp/tmp.8RcEwdXUFp at line 542 column 31 + /tmp/tmp.J1MIIy9ZIU at line 254 column 31 -***** assert (cond (linkage (pdist (x), "ward")), 17.195198,t); -***** assert (cond (linkage(x,"ward","euclidean")), 17.195198,t); -***** assert (cond (linkage(x,"ward",{"euclidean"})), 17.195198,t); -***** assert (cond (linkage(x,"ward",{"minkowski",2})),17.195198,t); -12 tests, 12 passed, 0 known failure, 0 skipped -[inst/lognstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/lognstat.m +warning: strmatch is obsolete; use strncmp or strcmp instead +1 test, 1 passed, 0 known failure, 0 skipped +[inst/copularnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/copularnd.m ***** test - mu = 0:0.2:1; - sigma = 0.2:0.2:1.2; - [m, v] = lognstat (mu, sigma); - expected_m = [1.0202, 1.3231, 1.7860, 2.5093, 3.6693, 5.5845]; - expected_v = [0.0425, 0.3038, 1.3823, 5.6447, 23.1345, 100.4437]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); + theta = 0.5; + x = copularnd ("Gaussian", theta); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** test - sigma = 0.2:0.2:1.2; - [m, v] = lognstat (0, sigma); - expected_m = [1.0202, 1.0833, 1.1972, 1.3771, 1.6487, 2.0544]; - expected_v = [0.0425, 0.2036, 0.6211, 1.7002, 4.6708, 13.5936]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gpinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/gpinv.m -***** shared x,y1,y2,y3 - x = [-1, 0, 1/2, 1, 2]; - y1 = [NaN, 0, 0.6931471805599453, Inf, NaN]; - y2 = [NaN, 0, 1, Inf, NaN]; - y3 = [NaN, 0, 1/2, 1, NaN]; -***** assert (gpinv (x, zeros (1,5), ones (1,5), zeros (1,5)), y1) -***** assert (gpinv (x, 0, 1, zeros (1,5)), y1) -***** assert (gpinv (x, 0, ones (1,5), 0), y1) -***** assert (gpinv (x, zeros (1,5), 1, 0), y1) -***** assert (gpinv (x, 0, 1, 0), y1) -***** assert (gpinv (x, 0, 1, [0, 0, NaN, 0, 0]), [y1(1:2), NaN, y1(4:5)]) -***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], 0), [y1(1:2), NaN, y1(4:5)]) -***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 0), [y1(1:2), NaN, y1(4:5)]) -***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, 0), [y1(1:2), NaN, y1(4:5)]) -***** assert (gpinv (x, ones (1,5), ones (1,5), zeros (1,5)), y2) -***** assert (gpinv (x, 1, 1, zeros (1,5)), y2) -***** assert (gpinv (x, 1, ones (1,5), 0), y2) -***** assert (gpinv (x, ones (1,5), 1, 0), y2) -***** assert (gpinv (x, 1, 1, 0), y2) -***** assert (gpinv (x, 1, 1, [0, 0, NaN, 0, 0]), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, 1, [1, 1, NaN, 1, 1], 0), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, [1, 1, NaN, 1, 1], 1, 0), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv ([x(1:2), NaN, x(4:5)], 1, 1, 0), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, -ones (1,5), ones (1,5), zeros (1,5)), y3) -***** assert (gpinv (x, -1, 1, zeros (1,5)), y3) -***** assert (gpinv (x, -1, ones (1,5), 0), y3) -***** assert (gpinv (x, -ones (1,5), 1, 0), y3) -***** assert (gpinv (x, -1, 1, 0), y3) -***** assert (gpinv (x, -1, 1, [0, 0, NaN, 0, 0]), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (x, -1, [1, 1, NaN, 1, 1], 0), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (x, -[1, 1, NaN, 1, 1], 1, 0), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv ([x(1:2), NaN, x(4:5)], -1, 1, 0), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], 0, single (1), 0), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], single (0), 1, 0), single ([y1, NaN])) -***** assert (gpinv (single ([x, NaN]), 1, 1, 0), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], 1, 1, single (0)), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], 1, single (1), 0), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], single (1), 1, 0), single ([y2, NaN])) -***** assert (gpinv (single ([x, NaN]), -1, 1, 0), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], -1, 1, single (0)), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], -1, single (1), 0), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], single (-1), 1, 0), single ([y3, NaN])) -***** error gpinv () -***** error gpinv (1) -***** error gpinv (1,2) -***** error gpinv (1,2,3) -***** error gpinv (1,2,3,4,5) -***** error gpinv (ones (3), ones (2), ones (2), ones (2)) -***** error gpinv (ones (2), ones (3), ones (2), ones (2)) -***** error gpinv (ones (2), ones (2), ones (3), ones (2)) -***** error gpinv (ones (2), ones (2), ones (2), ones (3)) -***** error gpinv (i, 2, 2, 2) -***** error gpinv (2, i, 2, 2) -***** error gpinv (2, 2, i, 2) -***** error gpinv (2, 2, 2, i) -52 tests, 52 passed, 0 known failure, 0 skipped -[inst/raylinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/raylinv.m + theta = 0.5; + nu = 2; + x = copularnd ("t", theta, nu); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** test - p = 0:0.1:0.5; + theta = 0.5; + x = copularnd ("Clayton", theta); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); +***** test + theta = 0.5; + n = 2; + x = copularnd ("Clayton", theta, n); + assert (size (x), [n, 2]); + assert (all ((x >= 0) & (x <= 1))); +***** test + theta = [1; 2]; + n = 2; + d = 3; + x = copularnd ("Clayton", theta, n, d); + assert (size (x), [n, d]); + assert (all ((x >= 0) & (x <= 1))); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/gevcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevcdf.m +***** test + x = 0:0.5:2.5; sigma = 1:6; - x = raylinv (p, sigma); - expected_x = [0.0000, 0.9181, 2.0041, 3.3784, 5.0538, 7.0645]; - assert (x, expected_x, 0.001); + k = 1; + mu = 0; + p = gevcdf (x, k, sigma, mu); + expected_p = [0.36788 0.44933 0.47237 0.48323 0.48954 0.49367]; + assert (p, expected_p, 0.001); ***** test - p = 0:0.1:0.5; - x = raylinv (p, 0.5); - expected_x = [0.0000, 0.2295, 0.3340, 0.4223, 0.5054, 0.5887]; - assert (x, expected_x, 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/mvnrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/mvnrnd.m -***** shared m, n, C, rho - m = 10; n = 3; rho = 0.4; C = rho*ones(n, n) + (1 - rho)*eye(n); -***** assert(size(mvnrnd(0, C, m)), [m n]) -***** assert(size(mvnrnd(zeros(1, n), C, m)), [m n]) -***** assert(size(mvnrnd(zeros(n, 1), C, m)), [m n]) -***** assert(size(mvnrnd(zeros(m, n), C, m)), [m n]) -***** assert(size(mvnrnd(zeros(m, n), C)), [m n]) -***** assert(size(mvnrnd(zeros(1, n), C)), [1 n]) -***** assert(size(mvnrnd(zeros(n, 1), C)), [1 n]) -***** error(mvnrnd(zeros(m+1, n), C, m)) -***** error(mvnrnd(zeros(1, n+1), C, m)) -***** error(mvnrnd(zeros(n+1, 1), C, m)) -***** error(mvnrnd(zeros(m, n), eye(n+1), m)) -***** error(mvnrnd(zeros(m, n), eye(n+1, n), m)) -12 tests, 12 passed, 0 known failure, 0 skipped + x = -0.5:0.5:2.5; + sigma = 0.5; + k = 1; + mu = 0; + p = gevcdf (x, k, sigma, mu); + expected_p = [0 0.36788 0.60653 0.71653 0.77880 0.81873 0.84648]; + assert (p, expected_p, 0.001); +***** test #check for continuity for k near 0 + x = 1; + sigma = 0.5; + k = -0.03:0.01:0.03; + mu = 0; + p = gevcdf (x, k, sigma, mu); + expected_p = [0.88062 0.87820 0.87580 0.87342 0.87107 0.86874 0.86643]; + assert (p, expected_p, 0.001); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/gevrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevrnd.m +***** assert(size (gevrnd (1,2,1)), [1, 1]); +***** assert(size (gevrnd (ones(2,1), 2, 1)), [2, 1]); +***** assert(size (gevrnd (ones(2,2), 2, 1)), [2, 2]); +***** assert(size (gevrnd (1, 2*ones(2,1), 1)), [2, 1]); +***** assert(size (gevrnd (1, 2*ones(2,2), 1)), [2, 2]); +***** assert(size (gevrnd (1, 2, 1, 3)), [3, 3]); +***** assert(size (gevrnd (1, 2, 1, [4 1])), [4, 1]); +***** assert(size (gevrnd (1, 2, 1, 4, 1)), [4, 1]); +***** error gevrnd () +***** error gevrnd (1, 2) +***** error gevrnd (ones(3),ones(2),1) +***** error gevrnd (ones(2),ones(3),1) +***** error gevrnd (i, 2, 1) +***** error gevrnd (2, i, 1) +***** error gevrnd (2, 0, 1) +***** error gevrnd (1,2, 1, -1) +***** error gevrnd (1,2, 1, ones(2)) +***** error gevrnd (1,2, 1, [2 -1 2]) +***** error gevrnd (1,2, 1, 1, ones(2)) +***** error gevrnd (1,2, 1, 1, -1) +***** error gevrnd (ones(2,2), 2, 1, 3) +***** error gevrnd (ones(2,2), 2, 1, [3, 2]) +***** error gevrnd (ones(2,2), 2, 1, 2, 3) +23 tests, 23 passed, 0 known failure, 0 skipped [inst/raylpdf.m] >>>>> /build/octave-statistics-1.4.2/inst/raylpdf.m ***** test @@ -4533,35 +3623,59 @@ expected_y = [0.0000, 1.2131, 0.5413, 0.0667, 0.0027, 0.0000]; assert (y, expected_y, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/chi2stat.m] ->>>>> /build/octave-statistics-1.4.2/inst/chi2stat.m +[inst/base/ppplot.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/ppplot.m +***** error ppplot () +***** error ppplot (ones (2,2)) +***** error ppplot (1, 2) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/base/crosstab.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/crosstab.m +***** error crosstab () +***** error crosstab (1) +***** error crosstab (1, 2, 3) +***** error crosstab (ones (2), [1 1]) +***** error crosstab ([1 1], ones (2)) +***** error crosstab ({true, true}, [1 1]) +***** error crosstab ([1 1], {true, true}) +***** error crosstab ([1], [1 1]) +***** error crosstab ([1 1], [1]) +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/base/qqplot.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/qqplot.m +***** error qqplot () +***** error qqplot ({1}) +***** error qqplot (ones (2,2)) +***** error qqplot (1, "foobar") +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/base/probit.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/probit.m +***** assert (probit ([-1, 0, 0.5, 1, 2]), [NaN, -Inf, 0, Inf, NaN]) +***** error probit () +***** error probit (1, 2) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/base/cloglog.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/cloglog.m +***** assert (cloglog (0), -Inf) +***** assert (cloglog (1), Inf) +***** assert (cloglog (1/e), 0) +***** error cloglog () +***** error cloglog (1, 2) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/base/logit.m] +>>>>> /build/octave-statistics-1.4.2/inst/base/logit.m ***** test - n = 1:6; - [m, v] = chi2stat (n); - assert (m, n); - assert (v, [2, 4, 6, 8, 10, 12], 0.001); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/gevfit.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevfit.m + p = [0.01:0.01:0.99]; + assert (logit (p), log (p ./ (1-p)), 25*eps); +***** assert (logit ([-1, 0, 0.5, 1, 2]), [NaN, -Inf, 0, +Inf, NaN]) +***** error logit () +***** error logit (1, 2) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/cdf.m ***** test - data = 1:50; - [pfit, pci] = gevfit (data); - expected_p = [-0.44 15.19 21.53]'; - expected_pu = [-0.13 19.31 26.49]'; - assert (pfit, expected_p, 0.1); - assert (pci(:, 2), expected_pu, 0.1); + assert(cdf ('norm', 1, 0, 1), normcdf (1, 0, 1)) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/iwishrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/iwishrnd.m -***** assert(size (iwishrnd (1,2,1)), [1, 1]); -***** assert(size (iwishrnd ([],2,1)), [1, 1]); -***** assert(size (iwishrnd ([3 1; 1 3], 2.00001, [], 1)), [2, 2]); -***** assert(size (iwishrnd (eye(2), 2, [], 3)), [2, 2, 3]); -***** error iwishrnd () -***** error iwishrnd (1) -***** error iwishrnd ([-3 1; 1 3],1) -***** error iwishrnd ([1; 1],1) -8 tests, 8 passed, 0 known failure, 0 skipped [inst/nansum.m] >>>>> /build/octave-statistics-1.4.2/inst/nansum.m ***** assert (nansum ([2 4 NaN 7]), 13) @@ -4574,413 +3688,24 @@ ***** assert (nansum (uint8 ([2 4 1 7]), "native"), uint8 (14)) ***** assert (nansum (uint8 ([2 4 1 7])), 14) 9 tests, 9 passed, 0 known failure, 0 skipped -[inst/copulapdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/copulapdf.m -***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - theta = [1; 2]; - p = copulapdf ("Clayton", x, theta); - expected_p = [0.9872; 0.7295]; - assert (p, expected_p, 0.001); -***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - p = copulapdf ("Gumbel", x, 2); - expected_p = [0.9468; 0.9468]; - assert (p, expected_p, 0.001); -***** test - x = [0.2, 0.6; 0.2, 0.6]; - theta = [1; 2]; - p = copulapdf ("Frank", x, theta); - expected_p = [0.9378; 0.8678]; - assert (p, expected_p, 0.001); -***** test - x = [0.2, 0.6; 0.2, 0.6]; - theta = [0.3; 0.7]; - p = copulapdf ("AMH", x, theta); - expected_p = [0.9540; 0.8577]; - assert (p, expected_p, 0.001); -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/burrrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/burrrnd.m -***** assert (size (burrrnd (1, 1, 1)), [1 1]) -***** assert (size (burrrnd (ones (2,1), 1, 1)), [2, 1]) -***** assert (size (burrrnd (ones (2,2), 1, 1)), [2, 2]) -***** assert (size (burrrnd (1, ones (2,1), 1)), [2, 1]) -***** assert (size (burrrnd (1, ones (2,2), 1)), [2, 2]) -***** assert (size (burrrnd (1, 1, ones (2,1))), [2, 1]) -***** assert (size (burrrnd (1, 1, ones (2,2))), [2, 2]) -***** assert (size (burrrnd (1, 1, 1, 3)), [3, 3]) -***** assert (size (burrrnd (1, 1, 1, [4 1])), [4, 1]) -***** assert (size (burrrnd (1, 1, 1, 4, 1)), [4, 1]) -***** assert (class (burrrnd (1,1,1)), "double") -***** assert (class (burrrnd (single (1),1,1)), "single") -***** assert (class (burrrnd (single ([1 1]),1,1)), "single") -***** assert (class (burrrnd (1,single (1),1)), "single") -***** assert (class (burrrnd (1,single ([1 1]),1)), "single") -***** assert (class (burrrnd (1,1,single (1))), "single") -***** assert (class (burrrnd (1,1,single ([1 1]))), "single") -***** error burrrnd () -***** error burrrnd (1) -***** error burrrnd (1,2) -***** error burrrnd (ones (3), ones (2), ones (2), 2) -***** error burrrnd (ones (2), ones (3), ones (2), 2) -***** error burrrnd (ones (2), ones (2), ones (3), 2) -***** error burrrnd (i, 2, 2) -***** error burrrnd (2, i, 2) -***** error burrrnd (2, 2, i) -***** error burrrnd (4,2,2, -1) -***** error burrrnd (4,2,2, ones (2)) -***** error burrrnd (4,2,2, [2 -1 2]) -***** error burrrnd (4*ones (2),2,2, 3) -***** error burrrnd (4*ones (2),2,2, [3, 2]) -***** error burrrnd (4*ones (2),2,2, 3, 2) -32 tests, 32 passed, 0 known failure, 0 skipped -[inst/mnrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/mnrnd.m -***** test - n = 10; - p = [0.2, 0.5, 0.3]; - x = mnrnd (n, p); - assert (size (x), size (p)); - assert (all (x >= 0)); - assert (all (round (x) == x)); - assert (sum (x) == n); -***** test - n = 10 * ones (3, 1); - p = [0.2, 0.5, 0.3]; - x = mnrnd (n, p); - assert (size (x), [length(n), length(p)]); - assert (all (x >= 0)); - assert (all (round (x) == x)); - assert (all (sum (x, 2) == n)); -***** test - n = (1:2)'; - p = [0.2, 0.5, 0.3; 0.1, 0.1, 0.8]; - x = mnrnd (n, p); - assert (size (x), size (p)); - assert (all (x >= 0)); - assert (all (round (x) == x)); - assert (all (sum (x, 2) == n)); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/fstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/fstat.m +[inst/gamstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/gamstat.m ***** test - m = 1:6; - n = 5:10; - [mn, v] = fstat (m, n); - expected_mn = [1.6667, 1.5000, 1.4000, 1.3333, 1.2857, 1.2500]; - expected_v = [22.2222, 6.7500, 3.4844, 2.2222, 1.5869, 1.2153]; - assert (mn, expected_mn, 0.001); + a = 1:6; + b = 1:0.2:2; + [m, v] = gamstat (a, b); + expected_m = [1.00, 2.40, 4.20, 6.40, 9.00, 12.00]; + expected_v = [1.00, 2.88, 5.88, 10.24, 16.20, 24.00]; + assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); ***** test - m = 1:6; - [mn, v] = fstat (m, 5); - expected_mn = [1.6667, 1.6667, 1.6667, 1.6667, 1.6667, 1.6667]; - expected_v = [22.2222, 13.8889, 11.1111, 9.7222, 8.8889, 8.3333]; - assert (mn, expected_mn, 0.001); + a = 1:6; + [m, v] = gamstat (a, 1.5); + expected_m = [1.50, 3.00, 4.50, 6.00, 7.50, 9.00]; + expected_v = [2.25, 4.50, 6.75, 9.00, 11.25, 13.50]; + assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/burrinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/burrinv.m -***** shared x,y - x = [-Inf, -1, 0, 1/2, 1, 2, Inf]; - y = [NaN, NaN, 0, 1 , Inf, NaN, NaN]; -***** assert (burrinv (x, ones (1,7), ones (1,7), ones(1,7)), y, eps) -***** assert (burrinv (x, 1, 1, 1), y, eps) -***** assert (burrinv (x, [1, 1, 1, NaN, 1, 1, 1], 1, 1), [y(1:3), NaN, y(5:7)], eps) -***** assert (burrinv (x, 1, [1, 1, 1, NaN, 1, 1, 1], 1), [y(1:3), NaN, y(5:7)], eps) -***** assert (burrinv (x, 1, 1, [1, 1, 1, NaN, 1, 1, 1]), [y(1:3), NaN, y(5:7)], eps) -***** assert (burrinv ([x, NaN], 1, 1, 1), [y, NaN], eps) -***** assert (burrinv (single ([x, NaN]), 1, 1, 1), single ([y, NaN]), eps('single')) -***** assert (burrinv ([x, NaN], single (1), 1, 1), single ([y, NaN]), eps('single')) -***** assert (burrinv ([x, NaN], 1, single (1), 1), single ([y, NaN]), eps('single')) -***** assert (burrinv ([x, NaN], 1, 1, single (1)), single ([y, NaN]), eps('single')) -***** error burrinv () -***** error burrinv (1) -***** error burrinv (1,2) -***** error burrinv (1,2,3) -***** error burrinv (1,2,3,4,5) -***** error burrinv (ones (3), ones (2), ones(2), ones(2)) -***** error burrinv (ones (2), ones (3), ones(2), ones(2)) -***** error burrinv (ones (2), ones (2), ones(3), ones(2)) -***** error burrinv (ones (2), ones (2), ones(2), ones(3)) -***** error burrinv (i, 2, 2, 2) -***** error burrinv (2, i, 2, 2) -***** error burrinv (2, 2, i, 2) -***** error burrinv (2, 2, 2, i) -23 tests, 23 passed, 0 known failure, 0 skipped -[inst/princomp.m] ->>>>> /build/octave-statistics-1.4.2/inst/princomp.m -***** shared COEFF,SCORE,latent,tsquare,m,x,R,V,lambda,i,S,F -***** test - x=[7 4 3 - 4 1 8 - 6 3 5 - 8 6 1 - 8 5 7 - 7 2 9 - 5 3 3 - 9 5 8 - 7 4 5 - 8 2 2]; - R = corrcoef (x); - [V, lambda] = eig (R); - [~, i] = sort(diag(lambda), "descend"); #arrange largest PC first - S = V(:, i) * diag(sqrt(diag(lambda)(i))); -***** assert(diag(S(:, 1:2)*S(:, 1:2)'), [0.8662; 0.8420; 0.9876], 1E-4); #contribution of first 2 PCs to each original variable - B = V(:, i) * diag( 1./ sqrt(diag(lambda)(i))); - F = zscore(x)*B; - [COEFF,SCORE,latent,tsquare] = princomp(zscore(x, 1)); -***** assert(tsquare,sumsq(F, 2),1E4*eps); -***** test - x=[1,2,3;2,1,3]'; - [COEFF,SCORE,latent,tsquare] = princomp(x); - m=[sqrt(2),sqrt(2);sqrt(2),-sqrt(2);-2*sqrt(2),0]/2; - m(:,1) = m(:,1)*sign(COEFF(1,1)); - m(:,2) = m(:,2)*sign(COEFF(1,2)); -***** assert(COEFF,m(1:2,:),10*eps); -***** assert(SCORE,-m,10*eps); -***** assert(latent,[1.5;.5],10*eps); -***** assert(tsquare,[4;4;4]/3,10*eps); -***** test - x=x'; - [COEFF,SCORE,latent,tsquare] = princomp(x); - m=[sqrt(2),sqrt(2),0;-sqrt(2),sqrt(2),0;0,0,2]/2; - m(:,1) = m(:,1)*sign(COEFF(1,1)); - m(:,2) = m(:,2)*sign(COEFF(1,2)); - m(:,3) = m(:,3)*sign(COEFF(3,3)); -***** assert(COEFF,m,10*eps); -***** assert(SCORE(:,1),-m(1:2,1),10*eps); -***** assert(SCORE(:,2:3),zeros(2),10*eps); -***** assert(latent,[1;0;0],10*eps); -***** assert(tsquare,[0.5;0.5],10*eps) -***** test - [COEFF,SCORE,latent,tsquare] = princomp(x, "econ"); -***** assert(COEFF,m(:, 1),10*eps); -***** assert(SCORE,-m(1:2,1),10*eps); -***** assert(latent,[1],10*eps); -***** assert(tsquare,[0.5;0.5],10*eps) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/bbscdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/bbscdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 1/2, 0.76024993890652337, 1]; -***** assert (bbscdf (x, ones (1,5), ones (1,5), zeros (1,5)), y, eps) -***** assert (bbscdf (x, 1, 1, zeros (1,5)), y, eps) -***** assert (bbscdf (x, 1, ones (1,5), 0), y, eps) -***** assert (bbscdf (x, ones (1,5), 1, 0), y, eps) -***** assert (bbscdf (x, 1, 1, 0), y, eps) -***** assert (bbscdf (x, 1, 1, [0, 0, NaN, 0, 0]), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbscdf (x, 1, [1, 1, NaN, 1, 1], 0), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbscdf (x, [1, 1, NaN, 1, 1], 1, 0), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbscdf ([x, NaN], 1, 1, 0), [y, NaN], eps) -***** assert (bbscdf (single ([x, NaN]), 1, 1, 0), single ([y, NaN]), eps('single')) -***** assert (bbscdf ([x, NaN], 1, 1, single (0)), single ([y, NaN]), eps('single')) -***** assert (bbscdf ([x, NaN], 1, single (1), 0), single ([y, NaN]), eps('single')) -***** assert (bbscdf ([x, NaN], single (1), 1, 0), single ([y, NaN]), eps('single')) -***** error bbscdf () -***** error bbscdf (1) -***** error bbscdf (1,2,3) -***** error bbscdf (1,2,3,4,5) -***** error bbscdf (ones (3), ones (2), ones(2), ones(2)) -***** error bbscdf (ones (2), ones (3), ones(2), ones(2)) -***** error bbscdf (ones (2), ones (2), ones(3), ones(2)) -***** error bbscdf (ones (2), ones (2), ones(2), ones(3)) -***** error bbscdf (i, 4, 3, 2) -***** error bbscdf (1, i, 3, 2) -***** error bbscdf (1, 4, i, 2) -***** error bbscdf (1, 4, 3, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/randsample.m] ->>>>> /build/octave-statistics-1.4.2/inst/randsample.m -***** test - n = 20; - k = 5; - x = randsample(n, k); - assert (size(x), [1 k]); - x = randsample(n, k, true); - assert (size(x), [1 k]); - x = randsample(n, k, false); - assert (size(x), [1 k]); - x = randsample(n, k, true, ones(n, 1)); - assert (size(x), [1 k]); - x = randsample(1:n, k); - assert (size(x), [1 k]); - x = randsample(1:n, k, true); - assert (size(x), [1 k]); - x = randsample(1:n, k, false); - assert (size(x), [1 k]); - x = randsample(1:n, k, true, ones(n, 1)); - assert (size(x), [1 k]); - x = randsample((1:n)', k); - assert (size(x), [k 1]); - x = randsample((1:n)', k, true); - assert (size(x), [k 1]); - x = randsample((1:n)', k, false); - assert (size(x), [k 1]); - x = randsample((1:n)', k, true, ones(n, 1)); - assert (size(x), [k 1]); - n = 10; - k = 100; - x = randsample(n, k, true, 1:n); - assert (size(x), [1 k]); - x = randsample((1:n)', k, true); - assert (size(x), [k 1]); - x = randsample(k, k, false, 1:k); - assert (size(x), [1 k]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/gppdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/gppdf.m -***** shared x,y1,y2,y3 - x = [-Inf, -1, 0, 1/2, 1, Inf]; - y1 = [0, 0, 1, 0.6065306597126334, 0.36787944117144233, 0]; - y2 = [0, 0, 1, 4/9, 1/4, 0]; - y3 = [0, 0, 1, 1, 1, 0]; -***** assert (gppdf (x, zeros (1,6), ones (1,6), zeros (1,6)), y1, eps) -***** assert (gppdf (x, 0, 1, zeros (1,6)), y1, eps) -***** assert (gppdf (x, 0, ones (1,6), 0), y1, eps) -***** assert (gppdf (x, zeros (1,6), 1, 0), y1, eps) -***** assert (gppdf (x, 0, 1, 0), y1, eps) -***** assert (gppdf (x, 0, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y1(5:6)]) -***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y1(5:6)]) -***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 0), [y1(1:3), NaN, y1(5:6)]) -***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, 0), [y1(1:3), NaN, y1(5:6)]) -***** assert (gppdf (x, ones (1,6), ones (1,6), zeros (1,6)), y2, eps) -***** assert (gppdf (x, 1, 1, zeros (1,6)), y2, eps) -***** assert (gppdf (x, 1, ones (1,6), 0), y2, eps) -***** assert (gppdf (x, ones (1,6), 1, 0), y2, eps) -***** assert (gppdf (x, 1, 1, 0), y2, eps) -***** assert (gppdf (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf ([x(1:3), NaN, x(5:6)], 1, 1, 0), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, -ones (1,6), ones (1,6), zeros (1,6)), y3, eps) -***** assert (gppdf (x, -1, 1, zeros (1,6)), y3, eps) -***** assert (gppdf (x, -1, ones (1,6), 0), y3, eps) -***** assert (gppdf (x, -ones (1,6), 1, 0), y3, eps) -***** assert (gppdf (x, -1, 1, 0), y3, eps) -***** assert (gppdf (x, -1, 1, [0, 0, 0, NaN, 0, 0]), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (x, -1, [1, 1, 1, NaN, 1, 1], 0), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (x, [-1, -1, -1, NaN, -1, -1], 1, 0), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf ([x(1:3), NaN, x(5:6)], -1, 1, 0), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], 0, single (1), 0), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], single (0), 1, 0), single ([y1, NaN])) -***** assert (gppdf (single ([x, NaN]), 1, 1, 0), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], 1, 1, single (0)), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], 1, single (1), 0), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], single (1), 1, 0), single ([y2, NaN])) -***** assert (gppdf (single ([x, NaN]), -1, 1, 0), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], -1, 1, single (0)), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], -1, single (1), 0), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], single (-1), 1, 0), single ([y3, NaN])) -***** error gppdf () -***** error gppdf (1) -***** error gppdf (1,2) -***** error gppdf (1,2,3) -***** error gppdf (1,2,3,4,5) -***** error gppdf (1, ones (2), ones (2), ones (3)) -***** error gppdf (1, ones (2), ones (3), ones (2)) -***** error gppdf (1, ones (3), ones (2), ones (2)) -***** error gppdf (i, 2, 2, 2) -***** error gppdf (2, i, 2, 2) -***** error gppdf (2, 2, i, 2) -***** error gppdf (2, 2, 2, i) -51 tests, 51 passed, 0 known failure, 0 skipped -[inst/wishpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/wishpdf.m -***** assert(wishpdf(4, 3, 3.1), 0.07702496, 1E-7); -***** assert(wishpdf([2 -0.3;-0.3 4], [1 0.3;0.3 1], 4), 0.004529741, 1E-7); -***** assert(wishpdf([6 2 5; 2 10 -5; 5 -5 25], [9 5 5; 5 10 -8; 5 -8 22], 5.1), 4.474865e-10, 1E-15); -***** error wishpdf () -***** error wishpdf (1, 2) -***** error wishpdf (1, 2, 0) -***** error wishpdf (1, 2) -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/ttest.m] ->>>>> /build/octave-statistics-1.4.2/inst/ttest.m -***** test - x = 8:0.1:12; - [h, pval, ci] = ttest (x, 10); - assert (h, 0) - assert (pval, 1, 10*eps) - assert (ci, [9.6219 10.3781], 1E-5) - [h, pval, ci0] = ttest (x, 0); - assert (h, 1) - assert (pval, 0) - assert (ci0, ci, 2e-15) - [h, pval, ci] = ttest (x, 10, "tail", "right", "dim", 2, "alpha", 0.05); - assert (h, 0) - assert (pval, 0.5, 10*eps) - assert (ci, [9.68498 Inf], 1E-5) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/stepwisefit.m] ->>>>> /build/octave-statistics-1.4.2/inst/stepwisefit.m -***** test - % Sample data from Draper and Smith (n = 13, k = 4) - X = [7 1 11 11 7 11 3 1 2 21 1 11 10; ... - 26 29 56 31 52 55 71 31 54 47 40 66 68; ... - 6 15 8 8 6 9 17 22 18 4 23 9 8; ... - 60 52 20 47 33 22 6 44 22 26 34 12 12]'; - y = [78.5 74.3 104.3 87.6 95.9 109.2 102.7 72.5 93.1 115.9 83.8 113.3 109.4]'; - [X_use, b, bint, r, rint, stats] = stepwisefit(y, X); - assert(X_use, [4 1]) - assert(b, regress(y, [ones(size(y)) X(:, X_use)], 0.05)) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/raylrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/raylrnd.m -***** test - sigma = 1:6; - x = raylrnd (sigma); - assert (size (x), size (sigma)); - assert (all (x >= 0)); -***** test - sigma = 0.5; - sz = [2, 3]; - x = raylrnd (sigma, sz); - assert (size (x), sz); - assert (all (x >= 0)); -***** test - sigma = 0.5; - r = 2; - c = 3; - x = raylrnd (sigma, r, c); - assert (size (x), [r, c]); - assert (all (x >= 0)); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/tricdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/tricdf.m -***** shared x,y - x = [-1, 0, 0.1, 0.5, 0.9, 1, 2] + 1; - y = [0, 0, 0.02, 0.5, 0.98, 1 1]; -***** assert (tricdf (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, eps) -***** assert (tricdf (x, 1*ones (1,7), 2, 1.5), y, eps) -***** assert (tricdf (x, 1, 2*ones (1,7), 1.5), y, eps) -***** assert (tricdf (x, 1, 2, 1.5*ones (1,7)), y, eps) -***** assert (tricdf (x, 1, 2, 1.5), y, eps) -***** assert (tricdf (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], eps) -***** assert (tricdf (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], eps) -***** assert (tricdf (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], eps) -***** assert (tricdf ([x, NaN], 1, 2, 1.5), [y, NaN], eps) -***** assert (tricdf (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (tricdf ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (tricdf ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) -***** assert (tricdf ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) -***** error tricdf () -***** error tricdf (1) -***** error tricdf (1,2) -***** error tricdf (1,2,3) -***** error tricdf (1,2,3,4,5) -***** error tricdf (1, ones (3), ones (2), ones (2)) -***** error tricdf (1, ones (2), ones (3), ones (2)) -***** error tricdf (1, ones (2), ones (2), ones (3)) -***** error tricdf (i, 2, 2, 2) -***** error tricdf (2, i, 2, 2) -***** error tricdf (2, 2, i, 2) -***** error tricdf (2, 2, 2, i) -25 tests, 25 passed, 0 known failure, 0 skipped [inst/triinv.m] >>>>> /build/octave-statistics-1.4.2/inst/triinv.m ***** shared x,y @@ -5012,177 +3737,128 @@ ***** error triinv (2, 2, i, 2) ***** error triinv (2, 2, 2, i) 25 tests, 25 passed, 0 known failure, 0 skipped -[inst/base/cloglog.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/cloglog.m -***** assert (cloglog (0), -Inf) -***** assert (cloglog (1), Inf) -***** assert (cloglog (1/e), 0) -***** error cloglog () -***** error cloglog (1, 2) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/base/ppplot.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/ppplot.m -***** error ppplot () -***** error ppplot (ones (2,2)) -***** error ppplot (1, 2) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/base/probit.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/probit.m -***** assert (probit ([-1, 0, 0.5, 1, 2]), [NaN, -Inf, 0, Inf, NaN]) -***** error probit () -***** error probit (1, 2) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/base/qqplot.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/qqplot.m -***** error qqplot () -***** error qqplot ({1}) -***** error qqplot (ones (2,2)) -***** error qqplot (1, "foobar") -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/base/logit.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/logit.m +[inst/combnk.m] +>>>>> /build/octave-statistics-1.4.2/inst/combnk.m +***** demo + c = combnk (1:5, 2); + disp ("All pairs of integers between 1 and 5:"); + disp (c); ***** test - p = [0.01:0.01:0.99]; - assert (logit (p), log (p ./ (1-p)), 25*eps); -***** assert (logit ([-1, 0, 0.5, 1, 2]), [NaN, -Inf, 0, +Inf, NaN]) -***** error logit () -***** error logit (1, 2) + c = combnk (1:3, 2); + assert (c, [1, 2; 1, 3; 2, 3]); +***** test + c = combnk (1:3, 6); + assert (isempty (c)); +***** test + c = combnk ({1, 2, 3}, 2); + assert (c, {1, 2; 1, 3; 2, 3}); +***** test + c = combnk ("hello", 2); + assert (c, ["lo"; "lo"; "ll"; "eo"; "el"; "el"; "ho"; "hl"; "hl"; "he"]); 4 tests, 4 passed, 0 known failure, 0 skipped -[inst/base/crosstab.m] ->>>>> /build/octave-statistics-1.4.2/inst/base/crosstab.m -***** error crosstab () -***** error crosstab (1) -***** error crosstab (1, 2, 3) -***** error crosstab (ones (2), [1 1]) -***** error crosstab ([1 1], ones (2)) -***** error crosstab ({true, true}, [1 1]) -***** error crosstab ([1 1], {true, true}) -***** error crosstab ([1], [1 1]) -***** error crosstab ([1 1], [1]) -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/gevrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/gevrnd.m -***** assert(size (gevrnd (1,2,1)), [1, 1]); -***** assert(size (gevrnd (ones(2,1), 2, 1)), [2, 1]); -***** assert(size (gevrnd (ones(2,2), 2, 1)), [2, 2]); -***** assert(size (gevrnd (1, 2*ones(2,1), 1)), [2, 1]); -***** assert(size (gevrnd (1, 2*ones(2,2), 1)), [2, 2]); -***** assert(size (gevrnd (1, 2, 1, 3)), [3, 3]); -***** assert(size (gevrnd (1, 2, 1, [4 1])), [4, 1]); -***** assert(size (gevrnd (1, 2, 1, 4, 1)), [4, 1]); -***** error gevrnd () -***** error gevrnd (1, 2) -***** error gevrnd (ones(3),ones(2),1) -***** error gevrnd (ones(2),ones(3),1) -***** error gevrnd (i, 2, 1) -***** error gevrnd (2, i, 1) -***** error gevrnd (2, 0, 1) -***** error gevrnd (1,2, 1, -1) -***** error gevrnd (1,2, 1, ones(2)) -***** error gevrnd (1,2, 1, [2 -1 2]) -***** error gevrnd (1,2, 1, 1, ones(2)) -***** error gevrnd (1,2, 1, 1, -1) -***** error gevrnd (ones(2,2), 2, 1, 3) -***** error gevrnd (ones(2,2), 2, 1, [3, 2]) -***** error gevrnd (ones(2,2), 2, 1, 2, 3) -23 tests, 23 passed, 0 known failure, 0 skipped -[inst/pdist2.m] ->>>>> /build/octave-statistics-1.4.2/inst/pdist2.m -***** function dist = euclidean_distance (x, y) - [m, p] = size (X); - [n, p] = size (Y); - D = zeros (m, n); - for i = 1:n - d = X - repmat (Y(i,:), [m 1]); - D(:,i) = sumsq (d, 2); - endfor -***** endfunction +[inst/gmdistribution.m] +>>>>> /build/octave-statistics-1.4.2/inst/gmdistribution.m ***** test - x = [1 1 1; 2 2 2; 3 3 3]; - y = [0 0 0; 1 2 3; 0 2 4; 4 7 1]; - d = sqrt([ 3 5 11 45 - 12 2 8 30 - 27 5 11 21]); - assert (pdist2 (x, y), d) + mu = eye(2); + Sigma = eye(2); + GM = gmdistribution (mu, Sigma); + density = GM.pdf ([0 0; 1 1]); + assert (density(1) - density(2), 0, 1e-6); + + [idx, nlogl, P, logpdf,M] = cluster (GM, eye(2)); + assert (idx, [1; 2]); + [idx2,nlogl2,P2,logpdf2] = GM.cluster (eye(2)); + assert (nlogl - nlogl2, 0, 1e-6); + [idx3,nlogl3,P3] = cluster (GM, eye(2)); + assert (P - P3, zeros (2), 1e-6); + [idx4,nlogl4] = cluster (GM, eye(2)); + assert (size (nlogl4), [1 1]); + idx5 = cluster (GM, eye(2)); + assert (idx - idx5, zeros (2,1)); + + D = GM.mahal ([1;0]); + assert (D - M(1,:), zeros (1,2), 1e-6); + + P = GM.posterior ([0 1]); + assert (P - P2(2,:), zeros (1,2), 1e-6); + + R = GM.random(20); + assert (size(R), [20, 2]); + + R = GM.random(); + assert (size(R), [1, 2]); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/tstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/tstat.m +[inst/runstest.m] +>>>>> /build/octave-statistics-1.4.2/inst/runstest.m ***** test - n = 3:8; - [m, v] = tstat (n); - expected_m = [0, 0, 0, 0, 0, 0]; - expected_v = [3.0000, 2.0000, 1.6667, 1.5000, 1.4000, 1.3333]; - assert (m, expected_m); - assert (v, expected_v, 0.001); + data = [-213 -564 -35 -15 141 115 -420 -360 203 -338 -431 194 -220 -513 154 -125 -559 92 -21 -579 -52 99 -543 -175 162 -457 -346 204 -300 -474 164 -107 -572 -8 83 -541 -224 180 -420 -374 201 -236 -531 83 27 -564 -112 131 -507 -254 199 -311 -495 143 -46 -579 -90 136 -472 -338 202 -287 -477 169 -124 -568 17 48 -568 -135 162 -430 -422 172 -74 -577 -13 92 -534 -243 194 -355 -465 156 -81 -578 -64 139 -449 -384 193 -198 -538 110 -44 -577 -6 66 -552 -164 161 -460 -344 205 -281 -504 134 -28 -576 -118 156 -437 -381 200 -220 -540 83 11 -568 -160 172 -414 -408 188 -125 -572 -32 139 -492 -321 205 -262 -504 142 -83 -574 0 48 -571 -106 137 -501 -266 190 -391 -406 194 -186 -553 83 -13 -577 -49 103 -515 -280 201 300 -506 131 -45 -578 -80 138 -462 -361 201 -211 -554 32 74 -533 -235 187 -372 -442 182 -147 -566 25 68 -535 -244 194 -351 -463 174 -125 -570 15 72 -550 -190 172 -424 -385 198 -218 -536 96]; #NIST beam deflection data, http://www.itl.nist.gov/div898/handbook/eda/section4/eda425.htm + [h, p, stats] = runstest (data); + expected_h = true; + expected_p = 0.0070646; + expected_z = 2.6938; + assert (h, expected_h); + assert (p, expected_p, 1E-6); + assert (stats.z, expected_z, 1E-4); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/mnpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/mnpdf.m -***** test - x = [1, 4, 2]; - p = [0.2, 0.5, 0.3]; - y = mnpdf (x, p); - assert (y, 0.11812, 0.001); -***** test - x = [1, 4, 2; 1, 0, 9]; - p = [0.2, 0.5, 0.3; 0.1, 0.1, 0.8]; - y = mnpdf (x, p); - assert (y, [0.11812; 0.13422], 0.001); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gprnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/gprnd.m -***** assert (size (gprnd (0,1,0)), [1, 1]) -***** assert (size (gprnd (0, 1, zeros (2,1))), [2, 1]) -***** assert (size (gprnd (0, 1, zeros (2,2))), [2, 2]) -***** assert (size (gprnd (0, ones (2,1), 0)), [2, 1]) -***** assert (size (gprnd (0, ones (2,2), 0)), [2, 2]) -***** assert (size (gprnd (zeros (2,1), 1, 0)), [2, 1]) -***** assert (size (gprnd (zeros (2,2), 1, 0)), [2, 2]) -***** assert (size (gprnd (0, 1, 0, 3)), [3, 3]) -***** assert (size (gprnd (0, 1, 0, [4 1])), [4, 1]) -***** assert (size (gprnd (0, 1, 0, 4, 1)), [4, 1]) -***** assert (size (gprnd (1,1,0)), [1, 1]) -***** assert (size (gprnd (1, 1, zeros (2,1))), [2, 1]) -***** assert (size (gprnd (1, 1, zeros (2,2))), [2, 2]) -***** assert (size (gprnd (1, ones (2,1), 0)), [2, 1]) -***** assert (size (gprnd (1, ones (2,2), 0)), [2, 2]) -***** assert (size (gprnd (ones (2,1), 1, 0)), [2, 1]) -***** assert (size (gprnd (ones (2,2), 1, 0)), [2, 2]) -***** assert (size (gprnd (1, 1, 0, 3)), [3, 3]) -***** assert (size (gprnd (1, 1, 0, [4 1])), [4, 1]) -***** assert (size (gprnd (1, 1, 0, 4, 1)), [4, 1]) -***** assert (size (gprnd (-1, 1, 0)), [1, 1]) -***** assert (size (gprnd (-1, 1, zeros (2,1))), [2, 1]) -***** assert (size (gprnd (1, -1, zeros (2,2))), [2, 2]) -***** assert (size (gprnd (-1, ones (2,1), 0)), [2, 1]) -***** assert (size (gprnd (-1, ones (2,2), 0)), [2, 2]) -***** assert (size (gprnd (-ones (2,1), 1, 0)), [2, 1]) -***** assert (size (gprnd (-ones (2,2), 1, 0)), [2, 2]) -***** assert (size (gprnd (-1, 1, 0, 3)), [3, 3]) -***** assert (size (gprnd (-1, 1, 0, [4 1])), [4, 1]) -***** assert (size (gprnd (-1, 1, 0, 4, 1)), [4, 1]) -***** assert (class (gprnd (0,1,0)), "double") -***** assert (class (gprnd (0, 1, single (0))), "single") -***** assert (class (gprnd (0, 1, single ([0 0]))), "single") -***** assert (class (gprnd (0,single (1),0)), "single") -***** assert (class (gprnd (0,single ([1 1]),0)), "single") -***** assert (class (gprnd (single (0), 1, 0)), "single") -***** assert (class (gprnd (single ([0 0]), 1, 0)), "single") -***** error gprnd () -***** error gprnd (1) -***** error gprnd (1,2) -***** error gprnd (zeros (2), ones (2), zeros (3)) -***** error gprnd (zeros (2), ones (3), zeros (2)) -***** error gprnd (zeros (3), ones (2), zeros (2)) -***** error gprnd (i, 1, 0) -***** error gprnd (0, i, 0) -***** error gprnd (0, 1, i) -***** error gprnd (0,1,0, -1) -***** error gprnd (0,1,0, ones (2)) -***** error gprnd (0,1,0, [2 -1 2]) -***** error gprnd (0,1, zeros (2), 3) -***** error gprnd (0,1, zeros (2), [3, 2]) -***** error gprnd (0,1, zeros (2), 3, 2) -52 tests, 52 passed, 0 known failure, 0 skipped +[inst/nakarnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/nakarnd.m +***** assert (size (nakarnd (1,1)), [1, 1]) +***** assert (size (nakarnd (ones (2,1), 1)), [2, 1]) +***** assert (size (nakarnd (ones (2,2), 1)), [2, 2]) +***** assert (size (nakarnd (1, ones (2,1))), [2, 1]) +***** assert (size (nakarnd (1, ones (2,2))), [2, 2]) +***** assert (size (nakarnd (1,1, 3)), [3, 3]) +***** assert (size (nakarnd (1,1, [4 1])), [4, 1]) +***** assert (size (nakarnd (1,1, 4, 1)), [4, 1]) +***** assert (class (nakarnd (1,1)), "double") +***** assert (class (nakarnd (single (1),1)), "single") +***** assert (class (nakarnd (single ([1 1]),1)), "single") +***** assert (class (nakarnd (1,single (1))), "single") +***** assert (class (nakarnd (1,single ([1 1]))), "single") +***** error nakarnd () +***** error nakarnd (1) +***** error nakarnd (zeros (3), ones (2)) +***** error nakarnd (zeros (2), ones (3)) +***** error nakarnd (i, 2) +***** error nakarnd (1, i) +***** error nakarnd (1,2, -1) +***** error nakarnd (1,2, ones (2)) +***** error nakarnd (1, 2, [2 -1 2]) +***** error nakarnd (1,2, 1, ones (2)) +***** error nakarnd (1,2, 1, -1) +***** error nakarnd (ones (2,2), 2, 3) +***** error nakarnd (ones (2,2), 2, [3, 2]) +***** error nakarnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/burrcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/burrcdf.m +***** shared x,y + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 1/2, 2/3, 1]; +***** assert (burrcdf (x, ones(1,5), ones (1,5), ones (1,5)), y, eps) +***** assert (burrcdf (x, 1, 1, 1), y, eps) +***** assert (burrcdf (x, [1, 1, NaN, 1, 1], 1, 1), [y(1:2), NaN, y(4:5)], eps) +***** assert (burrcdf (x, 1, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) +***** assert (burrcdf (x, 1, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) +***** assert (burrcdf ([x, NaN], 1, 1, 1), [y, NaN], eps) +***** assert (burrcdf (single ([x, NaN]), 1, 1, 1), single ([y, NaN]), eps('single')) +***** assert (burrcdf ([x, NaN], single (1), 1, 1), single ([y, NaN]), eps('single')) +***** assert (burrcdf ([x, NaN], 1, single (1), 1), single ([y, NaN]), eps('single')) +***** assert (burrcdf ([x, NaN], 1, 1, single (1)), single ([y, NaN]), eps('single')) +***** error burrcdf () +***** error burrcdf (1) +***** error burrcdf (1,2) +***** error burrcdf (1,2,3) +***** error burrcdf (1,2,3,4,5) +***** error burrcdf (ones (3), ones (2), ones(2), ones(2)) +***** error burrcdf (ones (2), ones (3), ones(2), ones(2)) +***** error burrcdf (ones (2), ones (2), ones(3), ones(2)) +***** error burrcdf (ones (2), ones (2), ones(2), ones(3)) +***** error burrcdf (i, 2, 2, 2) +***** error burrcdf (2, i, 2, 2) +***** error burrcdf (2, 2, i, 2) +***** error burrcdf (2, 2, 2, i) +23 tests, 23 passed, 0 known failure, 0 skipped [inst/binostat.m] >>>>> /build/octave-statistics-1.4.2/inst/binostat.m ***** test @@ -5215,645 +3891,430 @@ ***** assert (size (binostat (randi (100, 10, 5, 4), rand (10, 5, 4))), [10 5 4]) ***** assert (size (binostat (randi (100, 10, 5, 4), 7)), [10 5 4]) 10 tests, 10 passed, 0 known failure, 0 skipped -[inst/mahal.m] ->>>>> /build/octave-statistics-1.4.2/inst/mahal.m -***** error mahal () -***** error mahal (1, 2, 3) -***** error mahal ("A", "B") -***** error mahal ([1, 2], ["A", "B"]) -***** error mahal (ones (2, 2, 2)) -***** error mahal (ones (2, 2), ones (2, 2, 2)) -***** error mahal (ones (2, 2), ones (2, 3)) -***** test - X = [1 0; 0 1; 1 1; 0 0]; - assert (mahal (X, X), [1.5; 1.5; 1.5; 1.5], 10*eps) - assert (mahal (X, X+1), [7.5; 7.5; 1.5; 13.5], 10*eps) -***** assert (mahal ([true; true], [false; true]), [0.5; 0.5], eps) -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/gamstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/gamstat.m +[inst/lognstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/lognstat.m ***** test - a = 1:6; - b = 1:0.2:2; - [m, v] = gamstat (a, b); - expected_m = [1.00, 2.40, 4.20, 6.40, 9.00, 12.00]; - expected_v = [1.00, 2.88, 5.88, 10.24, 16.20, 24.00]; + mu = 0:0.2:1; + sigma = 0.2:0.2:1.2; + [m, v] = lognstat (mu, sigma); + expected_m = [1.0202, 1.3231, 1.7860, 2.5093, 3.6693, 5.5845]; + expected_v = [0.0425, 0.3038, 1.3823, 5.6447, 23.1345, 100.4437]; assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); ***** test - a = 1:6; - [m, v] = gamstat (a, 1.5); - expected_m = [1.50, 3.00, 4.50, 6.00, 7.50, 9.00]; - expected_v = [2.25, 4.50, 6.75, 9.00, 11.25, 13.50]; + sigma = 0.2:0.2:1.2; + [m, v] = lognstat (0, sigma); + expected_m = [1.0202, 1.0833, 1.1972, 1.3771, 1.6487, 2.0544]; + expected_v = [0.0425, 0.2036, 0.6211, 1.7002, 4.6708, 13.5936]; assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/raylstat.m] ->>>>> /build/octave-statistics-1.4.2/inst/raylstat.m +[inst/hygestat.m] +>>>>> /build/octave-statistics-1.4.2/inst/hygestat.m ***** test - sigma = 1:6; - [m, v] = raylstat (sigma); - expected_m = [1.2533, 2.5066, 3.7599, 5.0133, 6.2666, 7.5199]; - expected_v = [0.4292, 1.7168, 3.8628, 6.8673, 10.7301, 15.4513]; - assert (m, expected_m, 0.001); + t = 4:9; + m = 0:5; + n = 1:6; + [mn, v] = hygestat (t, m, n); + expected_mn = [0.0000, 0.4000, 1.0000, 1.7143, 2.5000, 3.3333]; + expected_v = [0.0000, 0.2400, 0.4000, 0.4898, 0.5357, 0.5556]; + assert (mn, expected_mn, 0.001); assert (v, expected_v, 0.001); +***** test + t = 4:9; + m = 0:5; + [mn, v] = hygestat (t, m, 2); + expected_mn = [0.0000, 0.4000, 0.6667, 0.8571, 1.0000, 1.1111]; + expected_v = [0.0000, 0.2400, 0.3556, 0.4082, 0.4286, 0.4321]; + assert (mn, expected_mn, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/stepwisefit.m] +>>>>> /build/octave-statistics-1.4.2/inst/stepwisefit.m +***** test + % Sample data from Draper and Smith (n = 13, k = 4) + X = [7 1 11 11 7 11 3 1 2 21 1 11 10; ... + 26 29 56 31 52 55 71 31 54 47 40 66 68; ... + 6 15 8 8 6 9 17 22 18 4 23 9 8; ... + 60 52 20 47 33 22 6 44 22 26 34 12 12]'; + y = [78.5 74.3 104.3 87.6 95.9 109.2 102.7 72.5 93.1 115.9 83.8 113.3 109.4]'; + [X_use, b, bint, r, rint, stats] = stepwisefit(y, X); + assert(X_use, [4 1]) + assert(b, regress(y, [ones(size(y)) X(:, X_use)], 0.05)) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/casewrite.m] ->>>>> /build/octave-statistics-1.4.2/inst/casewrite.m +[inst/hmmviterbi.m] +>>>>> /build/octave-statistics-1.4.2/inst/hmmviterbi.m ***** test - fname = [tempname() ".dat"]; - unwind_protect - s = ["a ";"bcd";"ef "]; - casewrite (s, fname) - names = caseread (fname); - unwind_protect_cleanup - unlink (fname); - end_unwind_protect - assert(names, s); + sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; + transprob = [0.8, 0.2; 0.4, 0.6]; + outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; + vpath = hmmviterbi (sequence, transprob, outprob); + expected = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; + assert (vpath, expected); +***** test + sequence = {'A', 'B', 'A', 'A', 'A', 'B', 'B', 'A', 'B', 'C', 'C', 'C', 'C', 'B', 'C', 'A', 'A', 'A', 'A', 'C', 'C', 'B', 'C', 'A', 'C'}; + transprob = [0.8, 0.2; 0.4, 0.6]; + outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; + symbols = {'A', 'B', 'C'}; + statenames = {'One', 'Two'}; + vpath = hmmviterbi (sequence, transprob, outprob, 'symbols', symbols, 'statenames', statenames); + expected = {'One', 'One', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'Two', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One'}; + assert (vpath, expected); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/pdist2.m] +>>>>> /build/octave-statistics-1.4.2/inst/pdist2.m +***** function dist = euclidean_distance (x, y) + [m, p] = size (X); + [n, p] = size (Y); + D = zeros (m, n); + for i = 1:n + d = X - repmat (Y(i,:), [m 1]); + D(:,i) = sumsq (d, 2); + endfor +***** endfunction +***** test + x = [1 1 1; 2 2 2; 3 3 3]; + y = [0 0 0; 1 2 3; 0 2 4; 4 7 1]; + d = sqrt([ 3 5 11 45 + 12 2 8 30 + 27 5 11 21]); + assert (pdist2 (x, y), d) 1 test, 1 passed, 0 known failure, 0 skipped -[inst/distributions/gampdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/gampdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = [0 exp(-x(2:end))]; -***** assert (gampdf (x, ones (1,5), ones (1,5)), y) -***** assert (gampdf (x, 1, ones (1,5)), y) -***** assert (gampdf (x, ones (1,5), 1), y) -***** assert (gampdf (x, [0 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN y(5)]) -***** assert (gampdf (x, 1, [0 -Inf NaN Inf 1]), [NaN NaN NaN 0 y(5)]) -***** assert (gampdf ([x, NaN], 1, 1), [y, NaN]) -***** assert (gampdf (single ([x, NaN]), 1, 1), single ([y, NaN])) -***** assert (gampdf ([x, NaN], single (1), 1), single ([y, NaN])) -***** assert (gampdf ([x, NaN], 1, single (1)), single ([y, NaN])) -***** error gampdf () -***** error gampdf (1) -***** error gampdf (1,2) -***** error gampdf (1,2,3,4) -***** error gampdf (ones (3), ones (2), ones (2)) -***** error gampdf (ones (2), ones (3), ones (2)) -***** error gampdf (ones (2), ones (2), ones (3)) -***** error gampdf (i, 2, 2) -***** error gampdf (2, i, 2) -***** error gampdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/normcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/normcdf.m -***** shared x,y - x = [-Inf 1 2 Inf]; - y = [0, 0.5, 1/2*(1+erf(1/sqrt(2))), 1]; -***** assert (normcdf (x, ones (1,4), ones (1,4)), y) -***** assert (normcdf (x, 1, ones (1,4)), y) -***** assert (normcdf (x, ones (1,4), 1), y) -***** assert (normcdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN]) -***** assert (normcdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN]) -***** assert (normcdf ([x(1:2) NaN x(4)], 1, 1), [y(1:2) NaN y(4)]) -***** assert (normcdf ([x, NaN], 1, 1), [y, NaN]) -***** assert (normcdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) -***** assert (normcdf ([x, NaN], single (1), 1), single ([y, NaN]), eps ("single")) -***** assert (normcdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps ("single")) -***** error normcdf () -***** error normcdf (1,2) -***** error normcdf (1,2,3,4) -***** error normcdf (ones (3), ones (2), ones (2)) -***** error normcdf (ones (2), ones (3), ones (2)) -***** error normcdf (ones (2), ones (2), ones (3)) -***** error normcdf (i, 2, 2) -***** error normcdf (2, i, 2) -***** error normcdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/cauchy_pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_pdf.m +[inst/burrpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/burrpdf.m ***** shared x,y - x = [-1 0 0.5 1 2]; - y = 1/pi * ( 2 ./ ((x-1).^2 + 2^2) ); -***** assert (cauchy_pdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (cauchy_pdf (x, 1, 2*ones (1,5)), y) -***** assert (cauchy_pdf (x, ones (1,5), 2), y) -***** assert (cauchy_pdf (x, [-Inf 1 NaN 1 Inf], 2), [NaN y(2) NaN y(4) NaN]) -***** assert (cauchy_pdf (x, 1, 2*[0 1 NaN 1 Inf]), [NaN y(2) NaN y(4) NaN]) -***** assert (cauchy_pdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (cauchy_pdf (single ([x, NaN]), 1, 2), single ([y, NaN]), eps ("single")) -***** assert (cauchy_pdf ([x, NaN], single (1), 2), single ([y, NaN]), eps ("single")) -***** assert (cauchy_pdf ([x, NaN], 1, single (2)), single ([y, NaN]), eps ("single")) + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 1/4, 1/9, 0]; +***** assert (burrpdf (x, ones(1,5), ones (1,5), ones (1,5)), y) +***** assert (burrpdf (x, 1, 1, 1), y) +***** assert (burrpdf (x, [1, 1, NaN, 1, 1], 1, 1), [y(1:2), NaN, y(4:5)]) +***** assert (burrpdf (x, 1, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)]) +***** assert (burrpdf (x, 1, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)]) +***** assert (burrpdf ([x, NaN], 1, 1, 1), [y, NaN]) +***** assert (burrpdf (single ([x, NaN]), 1, 1, 1), single ([y, NaN])) +***** assert (burrpdf ([x, NaN], single (1), 1, 1), single ([y, NaN])) +***** assert (burrpdf ([x, NaN], 1, single (1), 1), single ([y, NaN])) +***** assert (burrpdf ([x, NaN], 1, 1, single (1)), single ([y, NaN])) +***** error burrpdf () +***** error burrpdf (1) +***** error burrpdf (1,2) +***** error burrpdf (1,2,3) +***** error burrpdf (1,2,3,4,5) +***** error burrpdf (ones (3), ones (2), ones(2), ones(2)) +***** error burrpdf (ones (2), ones (3), ones(2), ones(2)) +***** error burrpdf (ones (2), ones (2), ones(3), ones(2)) +***** error burrpdf (ones (2), ones (2), ones(2), ones(3)) +***** error burrpdf (i, 2, 2, 2) +***** error burrpdf (2, i, 2, 2) +***** error burrpdf (2, 2, i, 2) +***** error burrpdf (2, 2, 2, i) +23 tests, 23 passed, 0 known failure, 0 skipped +[inst/mvnpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/mvnpdf.m +***** demo + mu = [0, 0]; + sigma = [1, 0.1; 0.1, 0.5]; + [X, Y] = meshgrid (linspace (-3, 3, 25)); + XY = [X(:), Y(:)]; + Z = mvnpdf (XY, mu, sigma); + mesh (X, Y, reshape (Z, size (X))); + colormap jet ***** test - x = rand (10, 1); - assert (cauchy_pdf (x, 0, 1), tpdf (x, 1), eps); -***** error cauchy_pdf () -***** error cauchy_pdf (1,2) -***** error cauchy_pdf (1,2,3,4) -***** error cauchy_pdf (ones (3), ones (2), ones (2)) -***** error cauchy_pdf (ones (2), ones (3), ones (2)) -***** error cauchy_pdf (ones (2), ones (2), ones (3)) -***** error cauchy_pdf (i, 2, 2) -***** error cauchy_pdf (2, i, 2) -***** error cauchy_pdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/logistic_cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_cdf.m -***** shared x,y - x = [-Inf -log(3) 0 log(3) Inf]; - y = [0, 1/4, 1/2, 3/4, 1]; -***** assert (logistic_cdf ([x, NaN]), [y, NaN], eps) -***** assert (logistic_cdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) -***** error logistic_cdf () -***** error logistic_cdf (1,2) -***** error logistic_cdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/unidinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unidinv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (unidinv (x, 10*ones (1,5)), [NaN NaN 5 10 NaN], eps) -***** assert (unidinv (x, 10), [NaN NaN 5 10 NaN], eps) -***** assert (unidinv (x, 10*[0 1 NaN 1 1]), [NaN NaN NaN 10 NaN], eps) -***** assert (unidinv ([x(1:2) NaN x(4:5)], 10), [NaN NaN NaN 10 NaN], eps) -***** assert (unidinv ([x, NaN], 10), [NaN NaN 5 10 NaN NaN], eps) -***** assert (unidinv (single ([x, NaN]), 10), single ([NaN NaN 5 10 NaN NaN]), eps) -***** assert (unidinv ([x, NaN], single (10)), single ([NaN NaN 5 10 NaN NaN]), eps) -***** error unidinv () -***** error unidinv (1) -***** error unidinv (1,2,3) -***** error unidinv (ones (3), ones (2)) -***** error unidinv (ones (2), ones (3)) -***** error unidinv (i, 2) -***** error unidinv (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/logncdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logncdf.m -***** shared x,y - x = [-1 0 1 e Inf]; - y = [0, 0, 0.5, 1/2+1/2*erf(1/2), 1]; -***** assert (logncdf (x, zeros (1,5), sqrt(2)*ones (1,5)), y, eps) -***** assert (logncdf (x, 0, sqrt(2)*ones (1,5)), y, eps) -***** assert (logncdf (x, zeros (1,5), sqrt(2)), y, eps) -***** assert (logncdf (x, [0 1 NaN 0 1], sqrt(2)), [0 0 NaN y(4:5)], eps) -***** assert (logncdf (x, 0, sqrt(2)*[0 NaN Inf 1 1]), [NaN NaN NaN y(4:5)], eps) -***** assert (logncdf ([x(1:3) NaN x(5)], 0, sqrt(2)), [y(1:3) NaN y(5)], eps) -***** assert (logncdf ([x, NaN], 0, sqrt(2)), [y, NaN], eps) -***** assert (logncdf (single ([x, NaN]), 0, sqrt(2)), single ([y, NaN]), eps ("single")) -***** assert (logncdf ([x, NaN], single (0), sqrt(2)), single ([y, NaN]), eps ("single")) -***** assert (logncdf ([x, NaN], 0, single (sqrt(2))), single ([y, NaN]), eps ("single")) -***** error logncdf () -***** error logncdf (1,2) -***** error logncdf (1,2,3,4) -***** error logncdf (ones (3), ones (2), ones (2)) -***** error logncdf (ones (2), ones (3), ones (2)) -***** error logncdf (ones (2), ones (2), ones (3)) -***** error logncdf (i, 2, 2) -***** error logncdf (2, i, 2) -***** error logncdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/betapdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/betapdf.m -***** shared x,y - x = [-1 0 0.5 1 2]; - y = [0 2 1 0 0]; -***** assert (betapdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (betapdf (x, 1, 2*ones (1,5)), y) -***** assert (betapdf (x, ones (1,5), 2), y) -***** assert (betapdf (x, [0 NaN 1 1 1], 2), [NaN NaN y(3:5)]) -***** assert (betapdf (x, 1, 2*[0 NaN 1 1 1]), [NaN NaN y(3:5)]) -***** assert (betapdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (betapdf (single ([x, NaN]), 1, 2), single ([y, NaN])) -***** assert (betapdf ([x, NaN], single (1), 2), single ([y, NaN])) -***** assert (betapdf ([x, NaN], 1, single (2)), single ([y, NaN])) + mu = [1,-1]; + sigma = [.9 .4; .4 .3]; + x = [ 0.5 -1.2; -0.5 -1.4; 0 -1.5]; + p = [ 0.41680003660313; 0.10278162359708; 0.27187267524566 ]; + q = mvnpdf (x, mu, sigma); + assert (p, q, 10*eps); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/chi2stat.m] +>>>>> /build/octave-statistics-1.4.2/inst/chi2stat.m ***** test - x = rand (10,1); - y = 1./(pi * sqrt (x.*(1-x))); - assert (betapdf (x, 1/2, 1/2), y, 50*eps); -***** assert (betapdf (0.5, 1000, 1000), 35.678, 1e-3) -***** error betapdf () -***** error betapdf (1) -***** error betapdf (1,2) -***** error betapdf (1,2,3,4) -***** error betapdf (ones (3), ones (2), ones (2)) -***** error betapdf (ones (2), ones (3), ones (2)) -***** error betapdf (ones (2), ones (2), ones (3)) -***** error betapdf (i, 2, 2) -***** error betapdf (2, i, 2) -***** error betapdf (2, 2, i) -21 tests, 21 passed, 0 known failure, 0 skipped -[inst/distributions/unifinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unifinv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (unifinv (x, ones (1,5), 2*ones (1,5)), [NaN 1 1.5 2 NaN]) -***** assert (unifinv (x, 1, 2*ones (1,5)), [NaN 1 1.5 2 NaN]) -***** assert (unifinv (x, ones (1,5), 2), [NaN 1 1.5 2 NaN]) -***** assert (unifinv (x, [1 2 NaN 1 1], 2), [NaN NaN NaN 2 NaN]) -***** assert (unifinv (x, 1, 2*[1 0 NaN 1 1]), [NaN NaN NaN 2 NaN]) -***** assert (unifinv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 1 NaN 2 NaN]) -***** assert (unifinv ([x, NaN], 1, 2), [NaN 1 1.5 2 NaN NaN]) -***** assert (unifinv (single ([x, NaN]), 1, 2), single ([NaN 1 1.5 2 NaN NaN])) -***** assert (unifinv ([x, NaN], single (1), 2), single ([NaN 1 1.5 2 NaN NaN])) -***** assert (unifinv ([x, NaN], 1, single (2)), single ([NaN 1 1.5 2 NaN NaN])) -***** error unifinv () -***** error unifinv (1,2) -***** error unifinv (1,2,3,4) -***** error unifinv (ones (3), ones (2), ones (2)) -***** error unifinv (ones (2), ones (3), ones (2)) -***** error unifinv (ones (2), ones (2), ones (3)) -***** error unifinv (i, 2, 2) -***** error unifinv (2, i, 2) -***** error unifinv (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/betacdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/betacdf.m -***** shared x,y - x = [-1 0 0.5 1 2]; - y = [0 0 0.75 1 1]; -***** assert (betacdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (betacdf (x, 1, 2*ones (1,5)), y) -***** assert (betacdf (x, ones (1,5), 2), y) -***** assert (betacdf (x, [0 1 NaN 1 1], 2), [NaN 0 NaN 1 1]) -***** assert (betacdf (x, 1, 2*[0 1 NaN 1 1]), [NaN 0 NaN 1 1]) -***** assert (betacdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) -***** assert (betacdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (betacdf (single ([x, NaN]), 1, 2), single ([y, NaN])) -***** assert (betacdf ([x, NaN], single (1), 2), single ([y, NaN])) -***** assert (betacdf ([x, NaN], 1, single (2)), single ([y, NaN])) -***** error betacdf () -***** error betacdf (1) -***** error betacdf (1,2) -***** error betacdf (1,2,3,4) -***** error betacdf (ones (3), ones (2), ones (2)) -***** error betacdf (ones (2), ones (3), ones (2)) -***** error betacdf (ones (2), ones (2), ones (3)) -17 tests, 17 passed, 0 known failure, 0 skipped -[inst/distributions/binocdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/binocdf.m -***** shared x,y - x = [-1 0 1 2 3]; - y = [0 1/4 3/4 1 1]; -***** assert (binocdf (x, 2*ones (1,5), 0.5*ones (1,5)), y, eps) -***** assert (binocdf (x, 2, 0.5*ones (1,5)), y, eps) -***** assert (binocdf (x, 2*ones (1,5), 0.5), y, eps) -***** assert (binocdf (x, 2*[0 -1 NaN 1.1 1], 0.5), [0 NaN NaN NaN 1]) -***** assert (binocdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 1]) -***** assert (binocdf ([x(1:2) NaN x(4:5)], 2, 0.5), [y(1:2) NaN y(4:5)], eps) -***** assert (binocdf ([x, NaN], 2, 0.5), [y, NaN], eps) -***** assert (binocdf (single ([x, NaN]), 2, 0.5), single ([y, NaN])) -***** assert (binocdf ([x, NaN], single (2), 0.5), single ([y, NaN])) -***** assert (binocdf ([x, NaN], 2, single (0.5)), single ([y, NaN])) -***** error binocdf () -***** error binocdf (1) -***** error binocdf (1,2) -***** error binocdf (1,2,3,4) -***** error binocdf (ones (3), ones (2), ones (2)) -***** error binocdf (ones (2), ones (3), ones (2)) -***** error binocdf (ones (2), ones (2), ones (3)) -***** error binocdf (i, 2, 2) -***** error binocdf (2, i, 2) -***** error binocdf (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_rnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_rnd.m -***** assert (size (laplace_rnd (3)), [3, 3]) -***** assert (size (laplace_rnd ([4 1])), [4, 1]) -***** assert (size (laplace_rnd (4,1)), [4, 1]) -***** error laplace_rnd () -***** error laplace_rnd (-1) -***** error laplace_rnd (ones (2)) -***** error laplace_rnd ([2 -1 2]) -***** error laplace_rnd (1, ones (2)) -***** error laplace_rnd (1, -1) + n = 1:6; + [m, v] = chi2stat (n); + assert (m, n); + assert (v, [2, 4, 6, 8, 10, 12], 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/fstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/fstat.m +***** test + m = 1:6; + n = 5:10; + [mn, v] = fstat (m, n); + expected_mn = [1.6667, 1.5000, 1.4000, 1.3333, 1.2857, 1.2500]; + expected_v = [22.2222, 6.7500, 3.4844, 2.2222, 1.5869, 1.2153]; + assert (mn, expected_mn, 0.001); + assert (v, expected_v, 0.001); +***** test + m = 1:6; + [mn, v] = fstat (m, 5); + expected_mn = [1.6667, 1.6667, 1.6667, 1.6667, 1.6667, 1.6667]; + expected_v = [22.2222, 13.8889, 11.1111, 9.7222, 8.8889, 8.3333]; + assert (mn, expected_mn, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/betastat.m] +>>>>> /build/octave-statistics-1.4.2/inst/betastat.m +***** test + a = -2:6; + b = 0.4:0.2:2; + [m, v] = betastat (a, b); + expected_m = [NaN NaN NaN 1/2 2/3.2 3/4.4 4/5.6 5/6.8 6/8]; + expected_v = [NaN NaN NaN 0.0833, 0.0558, 0.0402, 0.0309, 0.0250, 0.0208]; + assert (m, expected_m, eps*100); + assert (v, expected_v, 0.001); +***** test + a = -2:1:6; + [m, v] = betastat (a, 1.5); + expected_m = [NaN NaN NaN 1/2.5 2/3.5 3/4.5 4/5.5 5/6.5 6/7.5]; + expected_v = [NaN NaN NaN 0.0686, 0.0544, 0.0404, 0.0305, 0.0237, 0.0188]; + assert (m, expected_m); + assert (v, expected_v, 0.001); +***** test + a = [14 Inf 10 NaN 10]; + b = [12 9 NaN Inf 12]; + [m, v] = betastat (a, b); + expected_m = [14/26 NaN NaN NaN 10/22]; + expected_v = [168/18252 NaN NaN NaN 120/11132]; + assert (m, expected_m); + assert (v, expected_v); +***** assert (nthargout (1:2, @betastat, 5, []), {[], []}) +***** assert (nthargout (1:2, @betastat, [], 5), {[], []}) +***** assert (nthargout (1:2, @betastat, "", 5), {[], []}) +***** assert (nthargout (1:2, @betastat, true, 5), {1/6, 5/252}) +***** assert (size (betastat (rand (10, 5, 4), rand (10, 5, 4))), [10 5 4]) +***** assert (size (betastat (rand (10, 5, 4), 7)), [10 5 4]) 9 tests, 9 passed, 0 known failure, 0 skipped -[inst/distributions/cauchy_rnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_rnd.m -***** assert (size (cauchy_rnd (1,2)), [1, 1]) -***** assert (size (cauchy_rnd (ones (2,1), 2)), [2, 1]) -***** assert (size (cauchy_rnd (ones (2,2), 2)), [2, 2]) -***** assert (size (cauchy_rnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (cauchy_rnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (cauchy_rnd (1, 2, 3)), [3, 3]) -***** assert (size (cauchy_rnd (1, 2, [4 1])), [4, 1]) -***** assert (size (cauchy_rnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (cauchy_rnd (1, 2)), "double") -***** assert (class (cauchy_rnd (single (1), 2)), "single") -***** assert (class (cauchy_rnd (single ([1 1]), 2)), "single") -***** assert (class (cauchy_rnd (1, single (2))), "single") -***** assert (class (cauchy_rnd (1, single ([2 2]))), "single") -***** error cauchy_rnd () -***** error cauchy_rnd (1) -***** error cauchy_rnd (ones (3), ones (2)) -***** error cauchy_rnd (ones (2), ones (3)) -***** error cauchy_rnd (i, 2) -***** error cauchy_rnd (2, i) -***** error cauchy_rnd (1,2, -1) -***** error cauchy_rnd (1,2, ones (2)) -***** error cauchy_rnd (1,2, [2 -1 2]) -***** error cauchy_rnd (1,2, 1, ones (2)) -***** error cauchy_rnd (1,2, 1, -1) -***** error cauchy_rnd (ones (2,2), 2, 3) -***** error cauchy_rnd (ones (2,2), 2, [3, 2]) -***** error cauchy_rnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/chi2pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2pdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = [0, 1/2 * exp(-x(2:5)/2)]; -***** assert (chi2pdf (x, 2*ones (1,5)), y) -***** assert (chi2pdf (x, 2), y) -***** assert (chi2pdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) -***** assert (chi2pdf ([x, NaN], 2), [y, NaN]) -***** assert (chi2pdf (single ([x, NaN]), 2), single ([y, NaN])) -***** assert (chi2pdf ([x, NaN], single (2)), single ([y, NaN])) -***** error chi2pdf () -***** error chi2pdf (1) -***** error chi2pdf (1,2,3) -***** error chi2pdf (ones (3), ones (2)) -***** error chi2pdf (ones (2), ones (3)) -***** error chi2pdf (i, 2) -***** error chi2pdf (2, i) -13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/geornd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/geornd.m -***** assert (size (geornd (0.5)), [1, 1]) -***** assert (size (geornd (0.5*ones (2,1))), [2, 1]) -***** assert (size (geornd (0.5*ones (2,2))), [2, 2]) -***** assert (size (geornd (0.5, 3)), [3, 3]) -***** assert (size (geornd (0.5, [4 1])), [4, 1]) -***** assert (size (geornd (0.5, 4, 1)), [4, 1]) -***** assert (class (geornd (0.5)), "double") -***** assert (class (geornd (single (0.5))), "single") -***** assert (class (geornd (single ([0.5 0.5]))), "single") -***** assert (class (geornd (single (0))), "single") -***** assert (class (geornd (single (1))), "single") -***** error geornd () -***** error geornd (ones (3), ones (2)) -***** error geornd (ones (2), ones (3)) -***** error geornd (i) -***** error geornd (1, -1) -***** error geornd (1, ones (2)) -***** error geornd (1, [2 -1 2]) -***** error geornd (ones (2,2), 2, 3) -***** error geornd (ones (2,2), 3, 2) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/normrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/normrnd.m -***** assert (size (normrnd (1,2)), [1, 1]) -***** assert (size (normrnd (ones (2,1), 2)), [2, 1]) -***** assert (size (normrnd (ones (2,2), 2)), [2, 2]) -***** assert (size (normrnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (normrnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (normrnd (1, 2, 3)), [3, 3]) -***** assert (size (normrnd (1, 2, [4 1])), [4, 1]) -***** assert (size (normrnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (normrnd (1, 2)), "double") -***** assert (class (normrnd (single (1), 2)), "single") -***** assert (class (normrnd (single ([1 1]), 2)), "single") -***** assert (class (normrnd (1, single (2))), "single") -***** assert (class (normrnd (1, single ([2 2]))), "single") -***** error normrnd () -***** error normrnd (1) -***** error normrnd (ones (3), ones (2)) -***** error normrnd (ones (2), ones (3)) -***** error normrnd (i, 2) -***** error normrnd (2, i) -***** error normrnd (1,2, -1) -***** error normrnd (1,2, ones (2)) -***** error normrnd (1, 2, [2 -1 2]) -***** error normrnd (1,2, 1, ones (2)) -***** error normrnd (1,2, 1, -1) -***** error normrnd (ones (2,2), 2, 3) -***** error normrnd (ones (2,2), 2, [3, 2]) -***** error normrnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/exppdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/exppdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = gampdf (x, 1, 2); -***** assert (exppdf (x, 2*ones (1,5)), y) -***** assert (exppdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) -***** assert (exppdf ([x, NaN], 2), [y, NaN]) -***** assert (exppdf (single ([x, NaN]), 2), single ([y, NaN])) -***** assert (exppdf ([x, NaN], single (2)), single ([y, NaN])) -***** error exppdf () -***** error exppdf (1) -***** error exppdf (1,2,3) -***** error exppdf (ones (3), ones (2)) -***** error exppdf (ones (2), ones (3)) -***** error exppdf (i, 2) -***** error exppdf (2, i) -12 tests, 12 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_inv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_inv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (laplace_inv (x), [NaN -Inf 0 Inf NaN]) -***** assert (laplace_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) -***** assert (laplace_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) -***** error laplace_inv () -***** error laplace_inv (1,2) -***** error laplace_inv (i) -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/distributions/lognrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/lognrnd.m -***** assert (size (lognrnd (1,2)), [1, 1]) -***** assert (size (lognrnd (ones (2,1), 2)), [2, 1]) -***** assert (size (lognrnd (ones (2,2), 2)), [2, 2]) -***** assert (size (lognrnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (lognrnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (lognrnd (1, 2, 3)), [3, 3]) -***** assert (size (lognrnd (1, 2, [4 1])), [4, 1]) -***** assert (size (lognrnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (lognrnd (1, 2)), "double") -***** assert (class (lognrnd (single (1), 2)), "single") -***** assert (class (lognrnd (single ([1 1]), 2)), "single") -***** assert (class (lognrnd (1, single (2))), "single") -***** assert (class (lognrnd (1, single ([2 2]))), "single") -***** error lognrnd () -***** error lognrnd (1) -***** error lognrnd (ones (3), ones (2)) -***** error lognrnd (ones (2), ones (3)) -***** error lognrnd (i, 2) -***** error lognrnd (2, i) -***** error lognrnd (1,2, -1) -***** error lognrnd (1,2, ones (2)) -***** error lognrnd (1, 2, [2 -1 2]) -***** error lognrnd (1,2, 1, ones (2)) -***** error lognrnd (1,2, 1, -1) -***** error lognrnd (ones (2,2), 2, 3) -***** error lognrnd (ones (2,2), 2, [3, 2]) -***** error lognrnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/hygeinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/hygeinv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (hygeinv (x, 4*ones (1,5), 2*ones (1,5), 2*ones (1,5)), [NaN 0 1 2 NaN]) -***** assert (hygeinv (x, 4*ones (1,5), 2, 2), [NaN 0 1 2 NaN]) -***** assert (hygeinv (x, 4, 2*ones (1,5), 2), [NaN 0 1 2 NaN]) -***** assert (hygeinv (x, 4, 2, 2*ones (1,5)), [NaN 0 1 2 NaN]) -***** assert (hygeinv (x, 4*[1 -1 NaN 1.1 1], 2, 2), [NaN NaN NaN NaN NaN]) -***** assert (hygeinv (x, 4, 2*[1 -1 NaN 1.1 1], 2), [NaN NaN NaN NaN NaN]) -***** assert (hygeinv (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) -***** assert (hygeinv (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [NaN NaN NaN NaN NaN]) -***** assert (hygeinv (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) -***** assert (hygeinv ([x(1:2) NaN x(4:5)], 4, 2, 2), [NaN 0 NaN 2 NaN]) -***** assert (hygeinv ([x, NaN], 4, 2, 2), [NaN 0 1 2 NaN NaN]) -***** assert (hygeinv (single ([x, NaN]), 4, 2, 2), single ([NaN 0 1 2 NaN NaN])) -***** assert (hygeinv ([x, NaN], single (4), 2, 2), single ([NaN 0 1 2 NaN NaN])) -***** assert (hygeinv ([x, NaN], 4, single (2), 2), single ([NaN 0 1 2 NaN NaN])) -***** assert (hygeinv ([x, NaN], 4, 2, single (2)), single ([NaN 0 1 2 NaN NaN])) -***** error hygeinv () -***** error hygeinv (1) -***** error hygeinv (1,2) -***** error hygeinv (1,2,3) -***** error hygeinv (1,2,3,4,5) -***** error hygeinv (ones (2), ones (3), 1, 1) -***** error hygeinv (1, ones (2), ones (3), 1) -***** error hygeinv (1, 1, ones (2), ones (3)) -***** error hygeinv (i, 2, 2, 2) -***** error hygeinv (2, i, 2, 2) -***** error hygeinv (2, 2, i, 2) -***** error hygeinv (2, 2, 2, i) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/unidrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unidrnd.m -***** assert (size (unidrnd (2)), [1, 1]) -***** assert (size (unidrnd (ones (2,1))), [2, 1]) -***** assert (size (unidrnd (ones (2,2))), [2, 2]) -***** assert (size (unidrnd (10, [4 1])), [4, 1]) -***** assert (size (unidrnd (10, 4, 1)), [4, 1]) -***** assert (class (unidrnd (2)), "double") -***** assert (class (unidrnd (single (2))), "single") -***** assert (class (unidrnd (single ([2 2]))), "single") -***** error unidrnd () -***** error unidrnd (10, [1;2;3]) -***** error unidrnd (10, 2, ones (2)) -***** error unidrnd (10*ones (2), 2, 1) -***** error unidrnd (i) -13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/unifrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unifrnd.m -***** assert (size (unifrnd (1,2)), [1, 1]) -***** assert (size (unifrnd (ones (2,1), 2)), [2, 1]) -***** assert (size (unifrnd (ones (2,2), 2)), [2, 2]) -***** assert (size (unifrnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (unifrnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (unifrnd (1, 2, 3)), [3, 3]) -***** assert (size (unifrnd (1, 2, [4 1])), [4, 1]) -***** assert (size (unifrnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (unifrnd (1, 2)), "double") -***** assert (class (unifrnd (single (1), 2)), "single") -***** assert (class (unifrnd (single ([1 1]), 2)), "single") -***** assert (class (unifrnd (1, single (2))), "single") -***** assert (class (unifrnd (1, single ([2 2]))), "single") -***** error unifrnd () -***** error unifrnd (1) -***** error unifrnd (ones (3), ones (2)) -***** error unifrnd (ones (2), ones (3)) -***** error unifrnd (i, 2) -***** error unifrnd (2, i) -***** error unifrnd (1,2, -1) -***** error unifrnd (1,2, ones (2)) -***** error unifrnd (1, 2, [2 -1 2]) -***** error unifrnd (1,2, 1, ones (2)) -***** error unifrnd (1,2, 1, -1) -***** error unifrnd (ones (2,2), 2, 3) -***** error unifrnd (ones (2,2), 2, [3, 2]) -***** error unifrnd (ones (2,2), 2, 2, 3) -***** assert (unifrnd (0,0), 0) -***** assert (unifrnd (1,1), 1) -***** assert (unifrnd (1,0), NaN) -30 tests, 30 passed, 0 known failure, 0 skipped -[inst/distributions/tcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/tcdf.m +[inst/mnpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/mnpdf.m +***** test + x = [1, 4, 2]; + p = [0.2, 0.5, 0.3]; + y = mnpdf (x, p); + assert (y, 0.11812, 0.001); +***** test + x = [1, 4, 2; 1, 0, 9]; + p = [0.2, 0.5, 0.3; 0.1, 0.1, 0.8]; + y = mnpdf (x, p); + assert (y, [0.11812; 0.13422], 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/geostat.m] +>>>>> /build/octave-statistics-1.4.2/inst/geostat.m +***** test + p = 1 ./ (1:6); + [m, v] = geostat (p); + assert (m, [0, 1, 2, 3, 4, 5], 0.001); + assert (v, [0, 2, 6, 12, 20, 30], 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/tstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/tstat.m +***** test + n = 3:8; + [m, v] = tstat (n); + expected_m = [0, 0, 0, 0, 0, 0]; + expected_v = [3.0000, 2.0000, 1.6667, 1.5000, 1.4000, 1.3333]; + assert (m, expected_m); + assert (v, expected_v, 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/wblstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/wblstat.m +***** test + scale = 3:8; + shape = 1:6; + [m, v] = wblstat (scale, shape); + expected_m = [3.0000, 3.5449, 4.4649, 5.4384, 6.4272, 7.4218]; + expected_v = [9.0000, 3.4336, 2.6333, 2.3278, 2.1673, 2.0682]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +***** test + shape = 1:6; + [m, v] = wblstat (6, shape); + expected_m = [ 6.0000, 5.3174, 5.3579, 5.4384, 5.5090, 5.5663]; + expected_v = [36.0000, 7.7257, 3.7920, 2.3278, 1.5923, 1.1634]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/jackknife.m] +>>>>> /build/octave-statistics-1.4.2/inst/jackknife.m +***** test + ##Example from Quenouille, Table 1 + d=[0.18 4.00 1.04 0.85 2.14 1.01 3.01 2.33 1.57 2.19]; + jackstat = jackknife ( @(x) 1/mean(x), d ); + assert ( 10 / mean(d) - 9 * mean(jackstat), 0.5240, 1e-5 ); +***** demo + for k = 1:1000 + x=rand(10,1); + s(k)=std(x); + jackstat=jackknife(@std,x); + j(k)=10*std(x) - 9*mean(jackstat); + end + figure();hist([s',j'], 0:sqrt(1/12)/10:2*sqrt(1/12)) +***** demo + for k = 1:1000 + x=randn(1,50); + y=rand(1,50); + jackstat=jackknife(@(x) std(x{1})/std(x{2}),y,x); + j(k)=50*std(y)/std(x) - 49*mean(jackstat); + v(k)=sumsq((50*std(y)/std(x) - 49*jackstat) - j(k)) / (50 * 49); + end + t=(j-sqrt(1/12))./sqrt(v); + figure();plot(sort(tcdf(t,49)),"-;Almost linear mapping indicates good fit with t-distribution.;") +1 test, 1 passed, 0 known failure, 0 skipped +[inst/poisstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/poisstat.m +***** test + lambda = 1 ./ (1:6); + [m, v] = poisstat (lambda); + assert (m, lambda); + assert (v, lambda); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/nakacdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/nakacdf.m ***** shared x,y - x = [-Inf 0 1 Inf]; - y = [0 1/2 3/4 1]; -***** assert (tcdf (x, ones (1,4)), y, eps) -***** assert (tcdf (x, 1), y, eps) -***** assert (tcdf (x, [0 1 NaN 1]), [NaN 1/2 NaN 1], eps) -***** assert (tcdf ([x(1:2) NaN x(4)], 1), [y(1:2) NaN y(4)], eps) -***** assert (tcdf ([x, NaN], 1), [y, NaN], eps) -***** assert (tcdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) -***** assert (tcdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) -***** error tcdf () -***** error tcdf (1) -***** error tcdf (1,2,3) -***** error tcdf (ones (3), ones (2)) -***** error tcdf (ones (2), ones (3)) -***** error tcdf (i, 2) -***** error tcdf (2, i) -***** shared tol_rel - tol_rel = 10 * eps; -***** assert (tcdf (10^(-10), 2.5), 0.50000000003618087, -tol_rel) -***** assert (tcdf (10^(-11), 2.5), 0.50000000000361809, -tol_rel) -***** assert (tcdf (10^(-12), 2.5), 0.50000000000036181, -tol_rel) -***** assert (tcdf (10^(-13), 2.5), 0.50000000000003618, -tol_rel) -***** assert (tcdf (10^(-14), 2.5), 0.50000000000000362, -tol_rel) -***** assert (tcdf (10^(-15), 2.5), 0.50000000000000036, -tol_rel) -***** assert (tcdf (10^(-16), 2.5), 0.50000000000000004, -tol_rel) -***** assert (tcdf (-10^1, 2.5), 2.2207478836537124e-03, -tol_rel) -***** assert (tcdf (-10^2, 2.5), 7.1916492116661878e-06, -tol_rel) -***** assert (tcdf (-10^3, 2.5), 2.2747463948307452e-08, -tol_rel) -***** assert (tcdf (-10^4, 2.5), 7.1933970159922115e-11, -tol_rel) -***** assert (tcdf (-10^5, 2.5), 2.2747519231756221e-13, -tol_rel) -26 tests, 26 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_cdf.m + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 0.63212055882855778, 0.98168436111126578, 1]; +***** assert (nakacdf (x, ones (1,5), ones (1,5)), y, eps) +***** assert (nakacdf (x, 1, 1), y, eps) +***** assert (nakacdf (x, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)]) +***** assert (nakacdf (x, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)]) +***** assert (nakacdf ([x, NaN], 1, 1), [y, NaN], eps) +***** assert (nakacdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps('single')) +***** assert (nakacdf ([x, NaN], single (1), 1), single ([y, NaN]), eps('single')) +***** assert (nakacdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps('single')) +***** error nakacdf () +***** error nakacdf (1) +***** error nakacdf (1,2) +***** error nakacdf (1,2,3,4) +***** error nakacdf (ones (3), ones (2), ones(2)) +***** error nakacdf (ones (2), ones (3), ones(2)) +***** error nakacdf (ones (2), ones (2), ones(3)) +***** error nakacdf (i, 2, 2) +***** error nakacdf (2, i, 2) +***** error nakacdf (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/hmmgenerate.m] +>>>>> /build/octave-statistics-1.4.2/inst/hmmgenerate.m +***** test + len = 25; + transprob = [0.8, 0.2; 0.4, 0.6]; + outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; + [sequence, states] = hmmgenerate (len, transprob, outprob); + assert (length (sequence), len); + assert (length (states), len); + assert (min (sequence) >= 1); + assert (max (sequence) <= columns (outprob)); + assert (min (states) >= 1); + assert (max (states) <= rows (transprob)); +***** test + len = 25; + transprob = [0.8, 0.2; 0.4, 0.6]; + outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; + symbols = {'A', 'B', 'C'}; + statenames = {'One', 'Two'}; + [sequence, states] = hmmgenerate (len, transprob, outprob, 'symbols', symbols, 'statenames', statenames); + assert (length (sequence), len); + assert (length (states), len); + assert (strcmp (sequence, 'A') + strcmp (sequence, 'B') + strcmp (sequence, 'C') == ones (1, len)); + assert (strcmp (states, 'One') + strcmp (states, 'Two') == ones (1, len)); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/gevfit.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevfit.m +***** test + data = 1:50; + [pfit, pci] = gevfit (data); + expected_p = [-0.44 15.19 21.53]'; + expected_pu = [-0.13 19.31 26.49]'; + assert (pfit, expected_p, 0.1); + assert (pci(:, 2), expected_pu, 0.1); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/mnrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/mnrnd.m +***** test + n = 10; + p = [0.2, 0.5, 0.3]; + x = mnrnd (n, p); + assert (size (x), size (p)); + assert (all (x >= 0)); + assert (all (round (x) == x)); + assert (sum (x) == n); +***** test + n = 10 * ones (3, 1); + p = [0.2, 0.5, 0.3]; + x = mnrnd (n, p); + assert (size (x), [length(n), length(p)]); + assert (all (x >= 0)); + assert (all (round (x) == x)); + assert (all (sum (x, 2) == n)); +***** test + n = (1:2)'; + p = [0.2, 0.5, 0.3; 0.1, 0.1, 0.8]; + x = mnrnd (n, p); + assert (size (x), size (p)); + assert (all (x >= 0)); + assert (all (round (x) == x)); + assert (all (sum (x, 2) == n)); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/wishpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/wishpdf.m +***** assert(wishpdf(4, 3, 3.1), 0.07702496, 1E-7); +***** assert(wishpdf([2 -0.3;-0.3 4], [1 0.3;0.3 1], 4), 0.004529741, 1E-7); +***** assert(wishpdf([6 2 5; 2 10 -5; 5 -5 25], [9 5 5; 5 10 -8; 5 -8 22], 5.1), 4.474865e-10, 1E-15); +***** error wishpdf () +***** error wishpdf (1, 2) +***** error wishpdf (1, 2, 0) +***** error wishpdf (1, 2) +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/nakapdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/nakapdf.m ***** shared x,y - x = [-Inf -log(2) 0 log(2) Inf]; - y = [0, 1/4, 1/2, 3/4, 1]; -***** assert (laplace_cdf ([x, NaN]), [y, NaN]) -***** assert (laplace_cdf (single ([x, NaN])), single ([y, NaN])) -***** error laplace_cdf () -***** error laplace_cdf (1,2) -***** error laplace_cdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/poissrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/poissrnd.m -***** assert (size (poissrnd (2)), [1, 1]) -***** assert (size (poissrnd (ones (2,1))), [2, 1]) -***** assert (size (poissrnd (ones (2,2))), [2, 2]) -***** assert (size (poissrnd (1, 3)), [3, 3]) -***** assert (size (poissrnd (1, [4 1])), [4, 1]) -***** assert (size (poissrnd (1, 4, 1)), [4, 1]) -***** assert (class (poissrnd (2)), "double") -***** assert (class (poissrnd (single (2))), "single") -***** assert (class (poissrnd (single ([2 2]))), "single") -***** error poissrnd () -***** error poissrnd (1, -1) -***** error poissrnd (1, ones (2)) -***** error poissrnd (1, 2, ones (2)) -***** error poissrnd (i) -***** error poissrnd (1, 2, -1) -***** error poissrnd (1, [2 -1 2]) -***** error poissrnd (ones (2,2), 3) -***** error poissrnd (ones (2,2), [3, 2]) -***** error poissrnd (ones (2,2), 2, 3) -***** assert (poissrnd (0, 1, 1), 0) -***** assert (poissrnd ([0, 0, 0], [1, 3]), [0 0 0]) -21 tests, 21 passed, 0 known failure, 0 skipped -[inst/distributions/unifcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unifcdf.m + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 0.73575888234288467, 0.073262555554936715, 0]; +***** assert (nakapdf (x, ones (1,5), ones (1,5)), y, eps) +***** assert (nakapdf (x, 1, 1), y, eps) +***** assert (nakapdf (x, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) +***** assert (nakapdf (x, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) +***** assert (nakapdf ([x, NaN], 1, 1), [y, NaN], eps) +***** assert (nakapdf (single ([x, NaN]), 1, 1), single ([y, NaN])) +***** assert (nakapdf ([x, NaN], single (1), 1), single ([y, NaN])) +***** assert (nakapdf ([x, NaN], 1, single (1)), single ([y, NaN])) +***** error nakapdf () +***** error nakapdf (1) +***** error nakapdf (1,2) +***** error nakapdf (1,2,3,4) +***** error nakapdf (ones (3), ones (2), ones(2)) +***** error nakapdf (ones (2), ones (3), ones(2)) +***** error nakapdf (ones (2), ones (2), ones(3)) +***** error nakapdf (i, 2, 2) +***** error nakapdf (2, i, 2) +***** error nakapdf (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/kolmogorov_smirnov_cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/kolmogorov_smirnov_cdf.m +***** error kolmogorov_smirnov_cdf () +***** error kolmogorov_smirnov_cdf (1,2,3) +***** error kolmogorov_smirnov_cdf (1, ones (2)) +***** error kolmogorov_smirnov_cdf ([], 1) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/distributions/poisscdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/poisscdf.m ***** shared x,y - x = [-1 0 0.5 1 2] + 1; - y = [0 0 0.5 1 1]; -***** assert (unifcdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (unifcdf (x, 1, 2*ones (1,5)), y) -***** assert (unifcdf (x, ones (1,5), 2), y) -***** assert (unifcdf (x, [2 1 NaN 1 1], 2), [NaN 0 NaN 1 1]) -***** assert (unifcdf (x, 1, 2*[0 1 NaN 1 1]), [NaN 0 NaN 1 1]) -***** assert (unifcdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) -***** assert (unifcdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (unifcdf (single ([x, NaN]), 1, 2), single ([y, NaN])) -***** assert (unifcdf ([x, NaN], single (1), 2), single ([y, NaN])) -***** assert (unifcdf ([x, NaN], 1, single (2)), single ([y, NaN])) -***** error unifcdf () -***** error unifcdf (1,2) -***** error unifcdf (1,2,3,4) -***** error unifcdf (ones (3), ones (2), ones (2)) -***** error unifcdf (ones (2), ones (3), ones (2)) -***** error unifcdf (ones (2), ones (2), ones (3)) -***** error unifcdf (i, 2, 2) -***** error unifcdf (2, i, 2) -***** error unifcdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped + x = [-1 0 1 2 Inf]; + y = [0, gammainc(1, (x(2:4) +1), "upper"), 1]; +***** assert (poisscdf (x, ones (1,5)), y) +***** assert (poisscdf (x, 1), y) +***** assert (poisscdf (x, [1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) +***** assert (poisscdf ([x(1:2) NaN Inf x(5)], 1), [y(1:2) NaN 1 y(5)]) +***** assert (poisscdf ([x, NaN], 1), [y, NaN]) +***** assert (poisscdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) +***** assert (poisscdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) +***** error poisscdf () +***** error poisscdf (1) +***** error poisscdf (1,2,3) +***** error poisscdf (ones (3), ones (2)) +***** error poisscdf (ones (2), ones (3)) +***** error poisscdf (i, 2) +***** error poisscdf (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped [inst/distributions/hygepdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/hygepdf.m ***** shared x,y @@ -5885,17 +4346,36 @@ ***** error hygepdf (2, 2, i, 2) ***** error hygepdf (2, 2, 2, i) 25 tests, 25 passed, 0 known failure, 0 skipped -[inst/distributions/logistic_inv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_inv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (logistic_inv (x), [NaN -Inf 0 Inf NaN]) -***** assert (logistic_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) -***** assert (logistic_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) -***** error logistic_inv () -***** error logistic_inv (1,2) -***** error logistic_inv (i) -6 tests, 6 passed, 0 known failure, 0 skipped +[inst/distributions/gamrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/gamrnd.m +***** assert (size (gamrnd (1,2)), [1, 1]) +***** assert (size (gamrnd (ones (2,1), 2)), [2, 1]) +***** assert (size (gamrnd (ones (2,2), 2)), [2, 2]) +***** assert (size (gamrnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (gamrnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (gamrnd (1, 2, 3)), [3, 3]) +***** assert (size (gamrnd (1, 2, [4 1])), [4, 1]) +***** assert (size (gamrnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (gamrnd (1, 2)), "double") +***** assert (class (gamrnd (single (1), 2)), "single") +***** assert (class (gamrnd (single ([1 1]), 2)), "single") +***** assert (class (gamrnd (1, single (2))), "single") +***** assert (class (gamrnd (1, single ([2 2]))), "single") +***** error gamrnd () +***** error gamrnd (1) +***** error gamrnd (ones (3), ones (2)) +***** error gamrnd (ones (2), ones (3)) +***** error gamrnd (i, 2) +***** error gamrnd (2, i) +***** error gamrnd (1,2, -1) +***** error gamrnd (1,2, ones (2)) +***** error gamrnd (1, 2, [2 -1 2]) +***** error gamrnd (1,2, 1, ones (2)) +***** error gamrnd (1,2, 1, -1) +***** error gamrnd (ones (2,2), 2, 3) +***** error gamrnd (ones (2,2), 2, [3, 2]) +***** error gamrnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped [inst/distributions/expinv.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/expinv.m ***** shared x @@ -5915,6 +4395,164 @@ ***** error expinv (i, 2) ***** error expinv (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/nbincdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/nbincdf.m +***** shared x,y + x = [-1 0 1 2 Inf]; + y = [0 1/2 3/4 7/8 1]; +***** assert (nbincdf (x, ones (1,5), 0.5*ones (1,5)), y) +***** assert (nbincdf (x, 1, 0.5*ones (1,5)), y) +***** assert (nbincdf (x, ones (1,5), 0.5), y) +***** assert (nbincdf ([x(1:3) 0 x(5)], [0 1 NaN 1.5 Inf], 0.5), [NaN 1/2 NaN nbinpdf(0,1.5,0.5) NaN], eps) +***** assert (nbincdf (x, 1, 0.5*[-1 NaN 4 1 1]), [NaN NaN NaN y(4:5)]) +***** assert (nbincdf ([x(1:2) NaN x(4:5)], 1, 0.5), [y(1:2) NaN y(4:5)]) +***** assert (nbincdf ([x, NaN], 1, 0.5), [y, NaN]) +***** assert (nbincdf (single ([x, NaN]), 1, 0.5), single ([y, NaN])) +***** assert (nbincdf ([x, NaN], single (1), 0.5), single ([y, NaN])) +***** assert (nbincdf ([x, NaN], 1, single (0.5)), single ([y, NaN])) +***** error nbincdf () +***** error nbincdf (1) +***** error nbincdf (1,2) +***** error nbincdf (1,2,3,4) +***** error nbincdf (ones (3), ones (2), ones (2)) +***** error nbincdf (ones (2), ones (3), ones (2)) +***** error nbincdf (ones (2), ones (2), ones (3)) +***** error nbincdf (i, 2, 2) +***** error nbincdf (2, i, 2) +***** error nbincdf (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/distributions/unifrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unifrnd.m +***** assert (size (unifrnd (1,2)), [1, 1]) +***** assert (size (unifrnd (ones (2,1), 2)), [2, 1]) +***** assert (size (unifrnd (ones (2,2), 2)), [2, 2]) +***** assert (size (unifrnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (unifrnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (unifrnd (1, 2, 3)), [3, 3]) +***** assert (size (unifrnd (1, 2, [4 1])), [4, 1]) +***** assert (size (unifrnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (unifrnd (1, 2)), "double") +***** assert (class (unifrnd (single (1), 2)), "single") +***** assert (class (unifrnd (single ([1 1]), 2)), "single") +***** assert (class (unifrnd (1, single (2))), "single") +***** assert (class (unifrnd (1, single ([2 2]))), "single") +***** error unifrnd () +***** error unifrnd (1) +***** error unifrnd (ones (3), ones (2)) +***** error unifrnd (ones (2), ones (3)) +***** error unifrnd (i, 2) +***** error unifrnd (2, i) +***** error unifrnd (1,2, -1) +***** error unifrnd (1,2, ones (2)) +***** error unifrnd (1, 2, [2 -1 2]) +***** error unifrnd (1,2, 1, ones (2)) +***** error unifrnd (1,2, 1, -1) +***** error unifrnd (ones (2,2), 2, 3) +***** error unifrnd (ones (2,2), 2, [3, 2]) +***** error unifrnd (ones (2,2), 2, 2, 3) +***** assert (unifrnd (0,0), 0) +***** assert (unifrnd (1,1), 1) +***** assert (unifrnd (1,0), NaN) +30 tests, 30 passed, 0 known failure, 0 skipped +[inst/distributions/norminv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/norminv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (norminv (x, ones (1,5), ones (1,5)), [NaN -Inf 1 Inf NaN]) +***** assert (norminv (x, 1, ones (1,5)), [NaN -Inf 1 Inf NaN]) +***** assert (norminv (x, ones (1,5), 1), [NaN -Inf 1 Inf NaN]) +***** assert (norminv (x, [1 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) +***** assert (norminv (x, 1, [1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (norminv ([x(1:2) NaN x(4:5)], 1, 1), [NaN -Inf NaN Inf NaN]) +***** assert (norminv ([x, NaN], 1, 1), [NaN -Inf 1 Inf NaN NaN]) +***** assert (norminv (single ([x, NaN]), 1, 1), single ([NaN -Inf 1 Inf NaN NaN])) +***** assert (norminv ([x, NaN], single (1), 1), single ([NaN -Inf 1 Inf NaN NaN])) +***** assert (norminv ([x, NaN], 1, single (1)), single ([NaN -Inf 1 Inf NaN NaN])) +***** error norminv () +***** error norminv (1,2) +***** error norminv (1,2,3,4) +***** error norminv (ones (3), ones (2), ones (2)) +***** error norminv (ones (2), ones (3), ones (2)) +***** error norminv (ones (2), ones (2), ones (3)) +***** error norminv (i, 2, 2) +***** error norminv (2, i, 2) +***** error norminv (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/gampdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/gampdf.m +***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = [0 exp(-x(2:end))]; +***** assert (gampdf (x, ones (1,5), ones (1,5)), y) +***** assert (gampdf (x, 1, ones (1,5)), y) +***** assert (gampdf (x, ones (1,5), 1), y) +***** assert (gampdf (x, [0 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN y(5)]) +***** assert (gampdf (x, 1, [0 -Inf NaN Inf 1]), [NaN NaN NaN 0 y(5)]) +***** assert (gampdf ([x, NaN], 1, 1), [y, NaN]) +***** assert (gampdf (single ([x, NaN]), 1, 1), single ([y, NaN])) +***** assert (gampdf ([x, NaN], single (1), 1), single ([y, NaN])) +***** assert (gampdf ([x, NaN], 1, single (1)), single ([y, NaN])) +***** error gampdf () +***** error gampdf (1) +***** error gampdf (1,2) +***** error gampdf (1,2,3,4) +***** error gampdf (ones (3), ones (2), ones (2)) +***** error gampdf (ones (2), ones (3), ones (2)) +***** error gampdf (ones (2), ones (2), ones (3)) +***** error gampdf (i, 2, 2) +***** error gampdf (2, i, 2) +***** error gampdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/binocdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/binocdf.m +***** shared x,y + x = [-1 0 1 2 3]; + y = [0 1/4 3/4 1 1]; +***** assert (binocdf (x, 2*ones (1,5), 0.5*ones (1,5)), y, eps) +***** assert (binocdf (x, 2, 0.5*ones (1,5)), y, eps) +***** assert (binocdf (x, 2*ones (1,5), 0.5), y, eps) +***** assert (binocdf (x, 2*[0 -1 NaN 1.1 1], 0.5), [0 NaN NaN NaN 1]) +***** assert (binocdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 1]) +***** assert (binocdf ([x(1:2) NaN x(4:5)], 2, 0.5), [y(1:2) NaN y(4:5)], eps) +***** assert (binocdf ([x, NaN], 2, 0.5), [y, NaN], eps) +***** assert (binocdf (single ([x, NaN]), 2, 0.5), single ([y, NaN])) +***** assert (binocdf ([x, NaN], single (2), 0.5), single ([y, NaN])) +***** assert (binocdf ([x, NaN], 2, single (0.5)), single ([y, NaN])) +***** error binocdf () +***** error binocdf (1) +***** error binocdf (1,2) +***** error binocdf (1,2,3,4) +***** error binocdf (ones (3), ones (2), ones (2)) +***** error binocdf (ones (2), ones (3), ones (2)) +***** error binocdf (ones (2), ones (2), ones (3)) +***** error binocdf (i, 2, 2) +***** error binocdf (2, i, 2) +***** error binocdf (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/distributions/lognpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/lognpdf.m +***** shared x,y + x = [-1 0 e Inf]; + y = [0, 0, 1/(e*sqrt(2*pi)) * exp(-1/2), 0]; +***** assert (lognpdf (x, zeros (1,4), ones (1,4)), y, eps) +***** assert (lognpdf (x, 0, ones (1,4)), y, eps) +***** assert (lognpdf (x, zeros (1,4), 1), y, eps) +***** assert (lognpdf (x, [0 1 NaN 0], 1), [0 0 NaN y(4)], eps) +***** assert (lognpdf (x, 0, [0 NaN Inf 1]), [NaN NaN NaN y(4)], eps) +***** assert (lognpdf ([x, NaN], 0, 1), [y, NaN], eps) +***** assert (lognpdf (single ([x, NaN]), 0, 1), single ([y, NaN]), eps ("single")) +***** assert (lognpdf ([x, NaN], single (0), 1), single ([y, NaN]), eps ("single")) +***** assert (lognpdf ([x, NaN], 0, single (1)), single ([y, NaN]), eps ("single")) +***** error lognpdf () +***** error lognpdf (1,2) +***** error lognpdf (1,2,3,4) +***** error lognpdf (ones (3), ones (2), ones (2)) +***** error lognpdf (ones (2), ones (3), ones (2)) +***** error lognpdf (ones (2), ones (2), ones (3)) +***** error lognpdf (i, 2, 2) +***** error lognpdf (2, i, 2) +***** error lognpdf (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped [inst/distributions/nbininv.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/nbininv.m ***** shared x @@ -5947,26 +4585,102 @@ ***** error nbininv (2, i, 2) ***** error nbininv (2, 2, i) 24 tests, 24 passed, 0 known failure, 0 skipped -[inst/distributions/chi2cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2cdf.m +[inst/distributions/wblcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/wblcdf.m ***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = [0, 1-exp(-x(2:4)), 1]; +***** assert (wblcdf (x, ones (1,5), ones (1,5)), y) +***** assert (wblcdf (x, 1, ones (1,5)), y) +***** assert (wblcdf (x, ones (1,5), 1), y) +***** assert (wblcdf (x, [0 1 NaN Inf 1], 1), [NaN 0 NaN NaN 1]) +***** assert (wblcdf (x, 1, [0 1 NaN Inf 1]), [NaN 0 NaN NaN 1]) +***** assert (wblcdf ([x(1:2) NaN x(4:5)], 1, 1), [y(1:2) NaN y(4:5)]) +***** assert (wblcdf ([x, NaN], 1, 1), [y, NaN]) +***** assert (wblcdf (single ([x, NaN]), 1, 1), single ([y, NaN])) +***** assert (wblcdf ([x, NaN], single (1), 1), single ([y, NaN])) +***** assert (wblcdf ([x, NaN], 1, single (1)), single ([y, NaN])) +***** error wblcdf () +***** error wblcdf (1,2,3,4) +***** error wblcdf (ones (3), ones (2), ones (2)) +***** error wblcdf (ones (2), ones (3), ones (2)) +***** error wblcdf (ones (2), ones (2), ones (3)) +***** error wblcdf (i, 2, 2) +***** error wblcdf (2, i, 2) +***** error wblcdf (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/unidinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unidinv.m +***** shared x x = [-1 0 0.5 1 2]; - y = [0, 1 - exp(-x(2:end)/2)]; -***** assert (chi2cdf (x, 2*ones (1,5)), y, eps) -***** assert (chi2cdf (x, 2), y, eps) -***** assert (chi2cdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)], eps) -***** assert (chi2cdf ([x(1:2) NaN x(4:5)], 2), [y(1:2) NaN y(4:5)], eps) -***** assert (chi2cdf ([x, NaN], 2), [y, NaN], eps) -***** assert (chi2cdf (single ([x, NaN]), 2), single ([y, NaN]), eps ("single")) -***** assert (chi2cdf ([x, NaN], single (2)), single ([y, NaN]), eps ("single")) -***** error chi2cdf () -***** error chi2cdf (1) -***** error chi2cdf (1,2,3) -***** error chi2cdf (ones (3), ones (2)) -***** error chi2cdf (ones (2), ones (3)) -***** error chi2cdf (i, 2) -***** error chi2cdf (2, i) +***** assert (unidinv (x, 10*ones (1,5)), [NaN NaN 5 10 NaN], eps) +***** assert (unidinv (x, 10), [NaN NaN 5 10 NaN], eps) +***** assert (unidinv (x, 10*[0 1 NaN 1 1]), [NaN NaN NaN 10 NaN], eps) +***** assert (unidinv ([x(1:2) NaN x(4:5)], 10), [NaN NaN NaN 10 NaN], eps) +***** assert (unidinv ([x, NaN], 10), [NaN NaN 5 10 NaN NaN], eps) +***** assert (unidinv (single ([x, NaN]), 10), single ([NaN NaN 5 10 NaN NaN]), eps) +***** assert (unidinv ([x, NaN], single (10)), single ([NaN NaN 5 10 NaN NaN]), eps) +***** error unidinv () +***** error unidinv (1) +***** error unidinv (1,2,3) +***** error unidinv (ones (3), ones (2)) +***** error unidinv (ones (2), ones (3)) +***** error unidinv (i, 2) +***** error unidinv (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/geoinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/geoinv.m +***** shared x + x = [-1 0 0.75 1 2]; +***** assert (geoinv (x, 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (geoinv (x, 0.5), [NaN 0 1 Inf NaN]) +***** assert (geoinv (x, 0.5*[1 -1 NaN 4 1]), [NaN NaN NaN NaN NaN]) +***** assert (geoinv ([x(1:2) NaN x(4:5)], 0.5), [NaN 0 NaN Inf NaN]) +***** assert (geoinv ([x, NaN], 0.5), [NaN 0 1 Inf NaN NaN]) +***** assert (geoinv (single ([x, NaN]), 0.5), single ([NaN 0 1 Inf NaN NaN])) +***** assert (geoinv ([x, NaN], single (0.5)), single ([NaN 0 1 Inf NaN NaN])) +***** error geoinv () +***** error geoinv (1) +***** error geoinv (1,2,3) +***** error geoinv (ones (3), ones (2)) +***** error geoinv (ones (2), ones (3)) +***** error geoinv (i, 2) +***** error geoinv (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/exprnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/exprnd.m +***** assert (size (exprnd (2)), [1, 1]) +***** assert (size (exprnd (ones (2,1))), [2, 1]) +***** assert (size (exprnd (ones (2,2))), [2, 2]) +***** assert (size (exprnd (1, 3)), [3, 3]) +***** assert (size (exprnd (1, [4 1])), [4, 1]) +***** assert (size (exprnd (1, 4, 1)), [4, 1]) +***** assert (class (exprnd (1)), "double") +***** assert (class (exprnd (single (1))), "single") +***** assert (class (exprnd (single ([1 1]))), "single") +***** error exprnd () +***** error exprnd (1, -1) +***** error exprnd (1, ones (2)) +***** error exprnd (i) +***** error exprnd (1, [2 -1 2]) +***** error exprnd (1, 2, -1) +***** error exprnd (1, 2, ones (2)) +***** error exprnd (ones (2,2), 3) +***** error exprnd (ones (2,2), [3, 2]) +***** error exprnd (ones (2,2), 2, 3) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/stdnormal_rnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_rnd.m +***** assert (size (stdnormal_rnd (3)), [3, 3]) +***** assert (size (stdnormal_rnd ([4 1])), [4, 1]) +***** assert (size (stdnormal_rnd (4,1)), [4, 1]) +***** error stdnormal_rnd () +***** error stdnormal_rnd (-1) +***** error stdnormal_rnd (ones (2)) +***** error stdnormal_rnd ([2 -1 2]) +***** error stdnormal_rnd (1, ones (2)) +***** error stdnormal_rnd (1, -1) +9 tests, 9 passed, 0 known failure, 0 skipped [inst/distributions/wblinv.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/wblinv.m ***** shared x @@ -5990,157 +4704,29 @@ ***** error wblinv (2, i, 2) ***** error wblinv (2, 2, i) 18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/geopdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/geopdf.m -***** shared x,y - x = [-1 0 1 Inf]; - y = [0, 1/2, 1/4, NaN]; -***** assert (geopdf (x, 0.5*ones (1,4)), y) -***** assert (geopdf (x, 0.5), y) -***** assert (geopdf (x, 0.5*[-1 NaN 4 1]), [NaN NaN NaN y(4)]) -***** assert (geopdf ([x, NaN], 0.5), [y, NaN]) -***** assert (geopdf (single ([x, NaN]), 0.5), single ([y, NaN]), 5*eps ("single")) -***** assert (geopdf ([x, NaN], single (0.5)), single ([y, NaN]), 5*eps ("single")) -***** error geopdf () -***** error geopdf (1) -***** error geopdf (1,2,3) -***** error geopdf (ones (3), ones (2)) -***** error geopdf (ones (2), ones (3)) -***** error geopdf (i, 2) -***** error geopdf (2, i) -13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/stdnormal_cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_cdf.m -***** shared x,y - x = [-Inf 0 1 Inf]; - y = [0, 0.5, 1/2*(1+erf(1/sqrt(2))), 1]; -***** assert (stdnormal_cdf ([x, NaN]), [y, NaN]) -***** assert (stdnormal_cdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) -***** error stdnormal_cdf () -***** error stdnormal_cdf (1,2) -***** error stdnormal_cdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/poissinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/poissinv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (poissinv (x, ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (poissinv (x, 1), [NaN 0 1 Inf NaN]) -***** assert (poissinv (x, [1 0 NaN 1 1]), [NaN NaN NaN Inf NaN]) -***** assert (poissinv ([x(1:2) NaN x(4:5)], 1), [NaN 0 NaN Inf NaN]) -***** assert (poissinv ([x, NaN], 1), [NaN 0 1 Inf NaN NaN]) -***** assert (poissinv (single ([x, NaN]), 1), single ([NaN 0 1 Inf NaN NaN])) -***** assert (poissinv ([x, NaN], single (1)), single ([NaN 0 1 Inf NaN NaN])) -***** error poissinv () -***** error poissinv (1) -***** error poissinv (1,2,3) -***** error poissinv (ones (3), ones (2)) -***** error poissinv (ones (2), ones (3)) -***** error poissinv (i, 2) -***** error poissinv (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/stdnormal_rnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_rnd.m -***** assert (size (stdnormal_rnd (3)), [3, 3]) -***** assert (size (stdnormal_rnd ([4 1])), [4, 1]) -***** assert (size (stdnormal_rnd (4,1)), [4, 1]) -***** error stdnormal_rnd () -***** error stdnormal_rnd (-1) -***** error stdnormal_rnd (ones (2)) -***** error stdnormal_rnd ([2 -1 2]) -***** error stdnormal_rnd (1, ones (2)) -***** error stdnormal_rnd (1, -1) -9 tests, 9 passed, 0 known failure, 0 skipped -[inst/distributions/tinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/tinv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (tinv (x, ones (1,5)), [NaN -Inf 0 Inf NaN]) -***** assert (tinv (x, 1), [NaN -Inf 0 Inf NaN], eps) -***** assert (tinv (x, [1 0 NaN 1 1]), [NaN NaN NaN Inf NaN], eps) -***** assert (tinv ([x(1:2) NaN x(4:5)], 1), [NaN -Inf NaN Inf NaN]) -***** assert (tinv ([x, NaN], 1), [NaN -Inf 0 Inf NaN NaN], eps) -***** assert (tinv (single ([x, NaN]), 1), single ([NaN -Inf 0 Inf NaN NaN]), eps ("single")) -***** assert (tinv ([x, NaN], single (1)), single ([NaN -Inf 0 Inf NaN NaN]), eps ("single")) -***** error tinv () -***** error tinv (1) -***** error tinv (1,2,3) -***** error tinv (ones (3), ones (2)) -***** error tinv (ones (2), ones (3)) -***** error tinv (i, 2) -***** error tinv (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/trnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/trnd.m -***** assert (size (trnd (2)), [1, 1]) -***** assert (size (trnd (ones (2,1))), [2, 1]) -***** assert (size (trnd (ones (2,2))), [2, 2]) -***** assert (size (trnd (1, 3)), [3, 3]) -***** assert (size (trnd (1, [4 1])), [4, 1]) -***** assert (size (trnd (1, 4, 1)), [4, 1]) -***** assert (class (trnd (1)), "double") -***** assert (class (trnd (single (1))), "single") -***** assert (class (trnd (single ([1 1]))), "single") -***** error trnd () -***** error trnd (1, -1) -***** error trnd (1, ones (2)) -***** error trnd (i) -***** error trnd (1, [2 -1 2]) -***** error trnd (1, 2, ones (2)) -***** error trnd (1, 2, -1) -***** error trnd (ones (2,2), 3) -***** error trnd (ones (2,2), [3, 2]) -***** error trnd (ones (2,2), 2, 3) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/gamcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/gamcdf.m -***** shared x,y - x = [-1 0 0.5 1 2 Inf]; - y = [0, gammainc(x(2:end), 1)]; -***** assert (gamcdf (x, ones (1,6), ones (1,6)), y) -***** assert (gamcdf (x, 1, ones (1,6)), y) -***** assert (gamcdf (x, ones (1,6), 1), y) -***** assert (gamcdf (x, [0 -Inf NaN Inf 1 1], 1), [NaN NaN NaN NaN y(5:6)]) -***** assert (gamcdf (x, 1, [0 -Inf NaN Inf 1 1]), [NaN NaN NaN NaN y(5:6)]) -***** assert (gamcdf ([x(1:2) NaN x(4:6)], 1, 1), [y(1:2) NaN y(4:6)]) -***** assert (gamcdf ([x, NaN], 1, 1), [y, NaN]) -***** assert (gamcdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) -***** error gamcdf () -***** error gamcdf (1) -***** error gamcdf (1,2) -***** error gamcdf (1,2,3,4) -***** error gamcdf (ones (3), ones (2), ones (2)) -***** error gamcdf (ones (2), ones (3), ones (2)) -***** error gamcdf (ones (2), ones (2), ones (3)) -***** error gamcdf (i, 2, 2) -***** error gamcdf (2, i, 2) -***** error gamcdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/nbinpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/nbinpdf.m -***** shared x,y - x = [-1 0 1 2 Inf]; - y = [0 1/2 1/4 1/8 NaN]; -***** assert (nbinpdf (x, ones (1,5), 0.5*ones (1,5)), y) -***** assert (nbinpdf (x, 1, 0.5*ones (1,5)), y) -***** assert (nbinpdf (x, ones (1,5), 0.5), y) -***** assert (nbinpdf (x, [0 1 NaN 1.5 Inf], 0.5), [NaN 1/2 NaN 1.875*0.5^1.5/4 NaN], eps) -***** assert (nbinpdf (x, 1, 0.5*[-1 NaN 4 1 1]), [NaN NaN NaN y(4:5)]) -***** assert (nbinpdf ([x, NaN], 1, 0.5), [y, NaN]) -***** assert (nbinpdf (single ([x, NaN]), 1, 0.5), single ([y, NaN])) -***** assert (nbinpdf ([x, NaN], single (1), 0.5), single ([y, NaN])) -***** assert (nbinpdf ([x, NaN], 1, single (0.5)), single ([y, NaN])) -***** error nbinpdf () -***** error nbinpdf (1) -***** error nbinpdf (1,2) -***** error nbinpdf (1,2,3,4) -***** error nbinpdf (ones (3), ones (2), ones (2)) -***** error nbinpdf (ones (2), ones (3), ones (2)) -***** error nbinpdf (ones (2), ones (2), ones (3)) -***** error nbinpdf (i, 2, 2) -***** error nbinpdf (2, i, 2) -***** error nbinpdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/geornd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/geornd.m +***** assert (size (geornd (0.5)), [1, 1]) +***** assert (size (geornd (0.5*ones (2,1))), [2, 1]) +***** assert (size (geornd (0.5*ones (2,2))), [2, 2]) +***** assert (size (geornd (0.5, 3)), [3, 3]) +***** assert (size (geornd (0.5, [4 1])), [4, 1]) +***** assert (size (geornd (0.5, 4, 1)), [4, 1]) +***** assert (class (geornd (0.5)), "double") +***** assert (class (geornd (single (0.5))), "single") +***** assert (class (geornd (single ([0.5 0.5]))), "single") +***** assert (class (geornd (single (0))), "single") +***** assert (class (geornd (single (1))), "single") +***** error geornd () +***** error geornd (ones (3), ones (2)) +***** error geornd (ones (2), ones (3)) +***** error geornd (i) +***** error geornd (1, -1) +***** error geornd (1, ones (2)) +***** error geornd (1, [2 -1 2]) +***** error geornd (ones (2,2), 2, 3) +***** error geornd (ones (2,2), 3, 2) +20 tests, 20 passed, 0 known failure, 0 skipped [inst/distributions/finv.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/finv.m ***** shared x @@ -6166,48 +4752,46 @@ ***** error finv (2, i, 2) ***** error finv (2, 2, i) 20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/fpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/fpdf.m -***** test - x = rand (10,1); - x = x(x > 0.1 & x < 0.9); - y = tpdf (sqrt (x), 2) ./ sqrt (x); - assert (fpdf (x, 1, 2), y, 5*eps); +[inst/distributions/stdnormal_pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_pdf.m ***** shared x,y - x = [-1 0 0.5 1 2]; - y = [0 0 4/9 1/4 1/9]; -***** assert (fpdf (x, 2*ones (1,5), 2*ones (1,5)), y, eps) -***** assert (fpdf (x, 2, 2*ones (1,5)), y, eps) -***** assert (fpdf (x, 2*ones (1,5), 2), y, eps) -***** assert (fpdf (x, [0 NaN Inf 2 2], 2), [NaN NaN NaN y(4:5)], eps) -***** assert (fpdf (x, 2, [0 NaN Inf 2 2]), [NaN NaN NaN y(4:5)], eps) -***** assert (fpdf ([x, NaN], 2, 2), [y, NaN], eps) -***** assert (fpdf (single ([x, NaN]), 2, 2), single ([y, NaN]), eps ("single")) -***** assert (fpdf ([x, NaN], single (2), 2), single ([y, NaN]), eps ("single")) -***** assert (fpdf ([x, NaN], 2, single (2)), single ([y, NaN]), eps ("single")) -***** error fpdf () -***** error fpdf (1) -***** error fpdf (1,2) -***** error fpdf (1,2,3,4) -***** error fpdf (ones (3), ones (2), ones (2)) -***** error fpdf (ones (2), ones (3), ones (2)) -***** error fpdf (ones (2), ones (2), ones (3)) -***** error fpdf (i, 2, 2) -***** error fpdf (2, i, 2) -***** error fpdf (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/logistic_rnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_rnd.m -***** assert (size (logistic_rnd (3)), [3, 3]) -***** assert (size (logistic_rnd ([4 1])), [4, 1]) -***** assert (size (logistic_rnd (4,1)), [4, 1]) -***** error logistic_rnd () -***** error logistic_rnd (-1) -***** error logistic_rnd (ones (2)) -***** error logistic_rnd ([2 -1 2]) -***** error logistic_rnd (1, ones (2)) -***** error logistic_rnd (1, -1) -9 tests, 9 passed, 0 known failure, 0 skipped + x = [-Inf 0 1 Inf]; + y = 1/sqrt(2*pi)*exp (-x.^2/2); +***** assert (stdnormal_pdf ([x, NaN]), [y, NaN], eps) +***** assert (stdnormal_pdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) +***** error stdnormal_pdf () +***** error stdnormal_pdf (1,2) +***** error stdnormal_pdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/stdnormal_cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_cdf.m +***** shared x,y + x = [-Inf 0 1 Inf]; + y = [0, 0.5, 1/2*(1+erf(1/sqrt(2))), 1]; +***** assert (stdnormal_cdf ([x, NaN]), [y, NaN]) +***** assert (stdnormal_cdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) +***** error stdnormal_cdf () +***** error stdnormal_cdf (1,2) +***** error stdnormal_cdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/exppdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/exppdf.m +***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = gampdf (x, 1, 2); +***** assert (exppdf (x, 2*ones (1,5)), y) +***** assert (exppdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) +***** assert (exppdf ([x, NaN], 2), [y, NaN]) +***** assert (exppdf (single ([x, NaN]), 2), single ([y, NaN])) +***** assert (exppdf ([x, NaN], single (2)), single ([y, NaN])) +***** error exppdf () +***** error exppdf (1) +***** error exppdf (1,2,3) +***** error exppdf (ones (3), ones (2)) +***** error exppdf (ones (2), ones (3)) +***** error exppdf (i, 2) +***** error exppdf (2, i) +12 tests, 12 passed, 0 known failure, 0 skipped [inst/distributions/chi2inv.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2inv.m ***** shared x @@ -6227,132 +4811,134 @@ ***** error chi2inv (i, 2) ***** error chi2inv (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/norminv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/norminv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (norminv (x, ones (1,5), ones (1,5)), [NaN -Inf 1 Inf NaN]) -***** assert (norminv (x, 1, ones (1,5)), [NaN -Inf 1 Inf NaN]) -***** assert (norminv (x, ones (1,5), 1), [NaN -Inf 1 Inf NaN]) -***** assert (norminv (x, [1 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) -***** assert (norminv (x, 1, [1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (norminv ([x(1:2) NaN x(4:5)], 1, 1), [NaN -Inf NaN Inf NaN]) -***** assert (norminv ([x, NaN], 1, 1), [NaN -Inf 1 Inf NaN NaN]) -***** assert (norminv (single ([x, NaN]), 1, 1), single ([NaN -Inf 1 Inf NaN NaN])) -***** assert (norminv ([x, NaN], single (1), 1), single ([NaN -Inf 1 Inf NaN NaN])) -***** assert (norminv ([x, NaN], 1, single (1)), single ([NaN -Inf 1 Inf NaN NaN])) -***** error norminv () -***** error norminv (1,2) -***** error norminv (1,2,3,4) -***** error norminv (ones (3), ones (2), ones (2)) -***** error norminv (ones (2), ones (3), ones (2)) -***** error norminv (ones (2), ones (2), ones (3)) -***** error norminv (i, 2, 2) -***** error norminv (2, i, 2) -***** error norminv (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/unidcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/unidcdf.m +[inst/distributions/laplace_cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_cdf.m ***** shared x,y - x = [0 1 2.5 10 11]; - y = [0, 0.1 0.2 1.0 1.0]; -***** assert (unidcdf (x, 10*ones (1,5)), y) -***** assert (unidcdf (x, 10), y) -***** assert (unidcdf (x, 10*[0 1 NaN 1 1]), [NaN 0.1 NaN y(4:5)]) -***** assert (unidcdf ([x(1:2) NaN Inf x(5)], 10), [y(1:2) NaN 1 y(5)]) -***** assert (unidcdf ([x, NaN], 10), [y, NaN]) -***** assert (unidcdf (single ([x, NaN]), 10), single ([y, NaN])) -***** assert (unidcdf ([x, NaN], single (10)), single ([y, NaN])) -***** error unidcdf () -***** error unidcdf (1) -***** error unidcdf (1,2,3) -***** error unidcdf (ones (3), ones (2)) -***** error unidcdf (ones (2), ones (3)) -***** error unidcdf (i, 2) -***** error unidcdf (2, i) + x = [-Inf -log(2) 0 log(2) Inf]; + y = [0, 1/4, 1/2, 3/4, 1]; +***** assert (laplace_cdf ([x, NaN]), [y, NaN]) +***** assert (laplace_cdf (single ([x, NaN])), single ([y, NaN])) +***** error laplace_cdf () +***** error laplace_cdf (1,2) +***** error laplace_cdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/geocdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/geocdf.m +***** shared x,y + x = [-1 0 1 Inf]; + y = [0 0.5 0.75 1]; +***** assert (geocdf (x, 0.5*ones (1,4)), y) +***** assert (geocdf (x, 0.5), y) +***** assert (geocdf (x, 0.5*[-1 NaN 4 1]), [NaN NaN NaN y(4)]) +***** assert (geocdf ([x(1:2) NaN x(4)], 0.5), [y(1:2) NaN y(4)]) +***** assert (geocdf ([x, NaN], 0.5), [y, NaN]) +***** assert (geocdf (single ([x, NaN]), 0.5), single ([y, NaN])) +***** assert (geocdf ([x, NaN], single (0.5)), single ([y, NaN])) +***** error geocdf () +***** error geocdf (1) +***** error geocdf (1,2,3) +***** error geocdf (ones (3), ones (2)) +***** error geocdf (ones (2), ones (3)) +***** error geocdf (i, 2) +***** error geocdf (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/poisspdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/poisspdf.m +[inst/distributions/geopdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/geopdf.m ***** shared x,y - x = [-1 0 1 2 Inf]; - y = [0, exp(-1)*[1 1 0.5], 0]; -***** assert (poisspdf (x, ones (1,5)), y, eps) -***** assert (poisspdf (x, 1), y, eps) -***** assert (poisspdf (x, [1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)], eps) -***** assert (poisspdf ([x, NaN], 1), [y, NaN], eps) -***** assert (poisspdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) -***** assert (poisspdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) -***** error poisspdf () -***** error poisspdf (1) -***** error poisspdf (1,2,3) -***** error poisspdf (ones (3), ones (2)) -***** error poisspdf (ones (2), ones (3)) -***** error poisspdf (i, 2) -***** error poisspdf (2, i) + x = [-1 0 1 Inf]; + y = [0, 1/2, 1/4, NaN]; +***** assert (geopdf (x, 0.5*ones (1,4)), y) +***** assert (geopdf (x, 0.5), y) +***** assert (geopdf (x, 0.5*[-1 NaN 4 1]), [NaN NaN NaN y(4)]) +***** assert (geopdf ([x, NaN], 0.5), [y, NaN]) +***** assert (geopdf (single ([x, NaN]), 0.5), single ([y, NaN]), 5*eps ("single")) +***** assert (geopdf ([x, NaN], single (0.5)), single ([y, NaN]), 5*eps ("single")) +***** error geopdf () +***** error geopdf (1) +***** error geopdf (1,2,3) +***** error geopdf (ones (3), ones (2)) +***** error geopdf (ones (2), ones (3)) +***** error geopdf (i, 2) +***** error geopdf (2, i) 13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/stdnormal_inv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_inv.m +[inst/distributions/binoinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/binoinv.m ***** shared x x = [-1 0 0.5 1 2]; -***** assert (stdnormal_inv (x), [NaN -Inf 0 Inf NaN]) -***** assert (stdnormal_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) -***** assert (stdnormal_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) -***** error stdnormal_inv () -***** error stdnormal_inv (1,2) -***** error stdnormal_inv (i) -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/distributions/kolmogorov_smirnov_cdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/kolmogorov_smirnov_cdf.m -***** error kolmogorov_smirnov_cdf () -***** error kolmogorov_smirnov_cdf (1,2,3) -***** error kolmogorov_smirnov_cdf (1, ones (2)) -***** error kolmogorov_smirnov_cdf ([], 1) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/distributions/chi2rnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2rnd.m -***** assert (size (chi2rnd (2)), [1, 1]) -***** assert (size (chi2rnd (ones (2,1))), [2, 1]) -***** assert (size (chi2rnd (ones (2,2))), [2, 2]) -***** assert (size (chi2rnd (1, 3)), [3, 3]) -***** assert (size (chi2rnd (1, [4 1])), [4, 1]) -***** assert (size (chi2rnd (1, 4, 1)), [4, 1]) -***** assert (class (chi2rnd (2)), "double") -***** assert (class (chi2rnd (single (2))), "single") -***** assert (class (chi2rnd (single ([2 2]))), "single") -***** error chi2rnd () -***** error chi2rnd (ones (3), ones (2)) -***** error chi2rnd (ones (2), ones (3)) -***** error chi2rnd (i) -***** error chi2rnd (1, -1) -***** error chi2rnd (1, ones (2)) -***** error chi2rnd (1, [2 -1 2]) -***** error chi2rnd (ones (2,2), 3) -***** error chi2rnd (ones (2,2), [3, 2]) -***** error chi2rnd (ones (2,2), 2, 3) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/logninv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logninv.m +***** assert (binoinv (x, 2*ones (1,5), 0.5*ones (1,5)), [NaN 0 1 2 NaN]) +***** assert (binoinv (x, 2, 0.5*ones (1,5)), [NaN 0 1 2 NaN]) +***** assert (binoinv (x, 2*ones (1,5), 0.5), [NaN 0 1 2 NaN]) +***** assert (binoinv (x, 2*[0 -1 NaN 1.1 1], 0.5), [NaN NaN NaN NaN NaN]) +***** assert (binoinv (x, 2, 0.5*[0 -1 NaN 3 1]), [NaN NaN NaN NaN NaN]) +***** assert (binoinv ([x(1:2) NaN x(4:5)], 2, 0.5), [NaN 0 NaN 2 NaN]) +***** assert (binoinv ([x, NaN], 2, 0.5), [NaN 0 1 2 NaN NaN]) +***** assert (binoinv (single ([x, NaN]), 2, 0.5), single ([NaN 0 1 2 NaN NaN])) +***** assert (binoinv ([x, NaN], single (2), 0.5), single ([NaN 0 1 2 NaN NaN])) +***** assert (binoinv ([x, NaN], 2, single (0.5)), single ([NaN 0 1 2 NaN NaN])) +***** shared y, tol + y = magic (3) + 1; + tol = 1; +***** assert (binoinv (binocdf (1:10, 11, 0.1), 11, 0.1), 1:10, tol) +***** assert (binoinv (binocdf (1:10, 2*(1:10), 0.1), 2*(1:10), 0.1), 1:10, tol) +***** assert (binoinv (binocdf (y, 2*y, 1./y), 2*y, 1./y), y, tol) +***** error binoinv () +***** error binoinv (1) +***** error binoinv (1,2) +***** error binoinv (1,2,3,4) +***** error binoinv (ones (3), ones (2), ones (2)) +***** error binoinv (ones (2), ones (3), ones (2)) +***** error binoinv (ones (2), ones (2), ones (3)) +***** error binoinv (i, 2, 2) +***** error binoinv (2, i, 2) +***** error binoinv (2, 2, i) +23 tests, 23 passed, 0 known failure, 0 skipped +[inst/distributions/normpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/normpdf.m +***** shared x,y + x = [-Inf 1 2 Inf]; + y = 1/sqrt(2*pi)*exp (-(x-1).^2/2); +***** assert (normpdf (x, ones (1,4), ones (1,4)), y, eps) +***** assert (normpdf (x, 1, ones (1,4)), y, eps) +***** assert (normpdf (x, ones (1,4), 1), y, eps) +***** assert (normpdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN], eps) +***** assert (normpdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN], eps) +***** assert (normpdf ([x, NaN], 1, 1), [y, NaN], eps) +***** assert (normpdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) +***** assert (normpdf ([x, NaN], single (1), 1), single ([y, NaN]), eps ("single")) +***** assert (normpdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps ("single")) +***** error normpdf () +***** error normpdf (1,2) +***** error normpdf (1,2,3,4) +***** error normpdf (ones (3), ones (2), ones (2)) +***** error normpdf (ones (2), ones (3), ones (2)) +***** error normpdf (ones (2), ones (2), ones (3)) +***** error normpdf (i, 2, 2) +***** error normpdf (2, i, 2) +***** error normpdf (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/cauchy_inv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_inv.m ***** shared x x = [-1 0 0.5 1 2]; -***** assert (logninv (x, ones (1,5), ones (1,5)), [NaN 0 e Inf NaN]) -***** assert (logninv (x, 1, ones (1,5)), [NaN 0 e Inf NaN]) -***** assert (logninv (x, ones (1,5), 1), [NaN 0 e Inf NaN]) -***** assert (logninv (x, [1 1 NaN 0 1], 1), [NaN 0 NaN Inf NaN]) -***** assert (logninv (x, 1, [1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (logninv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 0 NaN Inf NaN]) -***** assert (logninv ([x, NaN], 1, 1), [NaN 0 e Inf NaN NaN]) -***** assert (logninv (single ([x, NaN]), 1, 1), single ([NaN 0 e Inf NaN NaN])) -***** assert (logninv ([x, NaN], single (1), 1), single ([NaN 0 e Inf NaN NaN])) -***** assert (logninv ([x, NaN], 1, single (1)), single ([NaN 0 e Inf NaN NaN])) -***** error logninv () -***** error logninv (1,2) -***** error logninv (1,2,3,4) -***** error logninv (ones (3), ones (2), ones (2)) -***** error logninv (ones (2), ones (3), ones (2)) -***** error logninv (ones (2), ones (2), ones (3)) -***** error logninv (i, 2, 2) -***** error logninv (2, i, 2) -***** error logninv (2, 2, i) +***** assert (cauchy_inv (x, ones (1,5), 2*ones (1,5)), [NaN -Inf 1 Inf NaN], eps) +***** assert (cauchy_inv (x, 1, 2*ones (1,5)), [NaN -Inf 1 Inf NaN], eps) +***** assert (cauchy_inv (x, ones (1,5), 2), [NaN -Inf 1 Inf NaN], eps) +***** assert (cauchy_inv (x, [1 -Inf NaN Inf 1], 2), [NaN NaN NaN NaN NaN]) +***** assert (cauchy_inv (x, 1, 2*[1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (cauchy_inv ([x(1:2) NaN x(4:5)], 1, 2), [NaN -Inf NaN Inf NaN]) +***** assert (cauchy_inv ([x, NaN], 1, 2), [NaN -Inf 1 Inf NaN NaN], eps) +***** assert (cauchy_inv (single ([x, NaN]), 1, 2), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) +***** assert (cauchy_inv ([x, NaN], single (1), 2), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) +***** assert (cauchy_inv ([x, NaN], 1, single (2)), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) +***** error cauchy_inv () +***** error cauchy_inv (1,2) +***** error cauchy_inv (1,2,3,4) +***** error cauchy_inv (ones (3), ones (2), ones (2)) +***** error cauchy_inv (ones (2), ones (3), ones (2)) +***** error cauchy_inv (ones (2), ones (2), ones (3)) +***** error cauchy_inv (i, 2, 2) +***** error cauchy_inv (2, i, 2) +***** error cauchy_inv (2, 2, i) 19 tests, 19 passed, 0 known failure, 0 skipped [inst/distributions/wblrnd.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/wblrnd.m @@ -6384,205 +4970,53 @@ ***** error wblrnd (ones (2,2), 2, [3, 2]) ***** error wblrnd (ones (2,2), 2, 2, 3) 27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/hygecdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/hygecdf.m -***** shared x,y - x = [-1 0 1 2 3]; - y = [0 1/6 5/6 1 1]; -***** assert (hygecdf (x, 4*ones (1,5), 2, 2), y, eps) -***** assert (hygecdf (x, 4, 2*ones (1,5), 2), y, eps) -***** assert (hygecdf (x, 4, 2, 2*ones (1,5)), y, eps) -***** assert (hygecdf (x, 4*[1 -1 NaN 1.1 1], 2, 2), [y(1) NaN NaN NaN y(5)], eps) -***** assert (hygecdf (x, 4, 2*[1 -1 NaN 1.1 1], 2), [y(1) NaN NaN NaN y(5)], eps) -***** assert (hygecdf (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) -***** assert (hygecdf (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [y(1) NaN NaN NaN y(5)], eps) -***** assert (hygecdf (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) -***** assert (hygecdf ([x(1:2) NaN x(4:5)], 4, 2, 2), [y(1:2) NaN y(4:5)], eps) -***** assert (hygecdf ([x, NaN], 4, 2, 2), [y, NaN], eps) -***** assert (hygecdf (single ([x, NaN]), 4, 2, 2), single ([y, NaN]), eps ("single")) -***** assert (hygecdf ([x, NaN], single (4), 2, 2), single ([y, NaN]), eps ("single")) -***** assert (hygecdf ([x, NaN], 4, single (2), 2), single ([y, NaN]), eps ("single")) -***** assert (hygecdf ([x, NaN], 4, 2, single (2)), single ([y, NaN]), eps ("single")) -***** error hygecdf () -***** error hygecdf (1) -***** error hygecdf (1,2) -***** error hygecdf (1,2,3) -***** error hygecdf (1,2,3,4,5) -***** error hygecdf (ones (2), ones (3), 1, 1) -***** error hygecdf (1, ones (2), ones (3), 1) -***** error hygecdf (1, 1, ones (2), ones (3)) -***** error hygecdf (i, 2, 2, 2) -***** error hygecdf (2, i, 2, 2) -***** error hygecdf (2, 2, i, 2) -***** error hygecdf (2, 2, 2, i) -26 tests, 26 passed, 0 known failure, 0 skipped -[inst/distributions/binornd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/binornd.m -***** assert (binornd (0, 0, 1), 0) -***** assert (binornd ([0, 0], [0, 0], 1, 2), [0, 0]) -***** assert (size (binornd (2, 1/2)), [1, 1]) -***** assert (size (binornd (2*ones (2,1), 1/2)), [2, 1]) -***** assert (size (binornd (2*ones (2,2), 1/2)), [2, 2]) -***** assert (size (binornd (2, 1/2*ones (2,1))), [2, 1]) -***** assert (size (binornd (2, 1/2*ones (2,2))), [2, 2]) -***** assert (size (binornd (2, 1/2, 3)), [3, 3]) -***** assert (size (binornd (2, 1/2, [4 1])), [4, 1]) -***** assert (size (binornd (2, 1/2, 4, 1)), [4, 1]) -***** assert (class (binornd (2, 0.5)), "double") -***** assert (class (binornd (single (2), 0.5)), "single") -***** assert (class (binornd (single ([2 2]), 0.5)), "single") -***** assert (class (binornd (2, single (0.5))), "single") -***** assert (class (binornd (2, single ([0.5 0.5]))), "single") -***** error binornd () -***** error binornd (1) -***** error binornd (ones (3), ones (2)) -***** error binornd (ones (2), ones (3)) -***** error binornd (i, 2) -***** error binornd (2, i) -***** error binornd (1,2, -1) -***** error binornd (1,2, ones (2)) -***** error binornd (1,2, [2 -1 2]) -***** error binornd (1,2, 1, ones (2)) -***** error binornd (1,2, 1, -1) -***** error binornd (ones (2,2), 2, 3) -***** error binornd (ones (2,2), 2, [3, 2]) -***** error binornd (ones (2,2), 2, 2, 3) -29 tests, 29 passed, 0 known failure, 0 skipped -[inst/distributions/gamrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/gamrnd.m -***** assert (size (gamrnd (1,2)), [1, 1]) -***** assert (size (gamrnd (ones (2,1), 2)), [2, 1]) -***** assert (size (gamrnd (ones (2,2), 2)), [2, 2]) -***** assert (size (gamrnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (gamrnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (gamrnd (1, 2, 3)), [3, 3]) -***** assert (size (gamrnd (1, 2, [4 1])), [4, 1]) -***** assert (size (gamrnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (gamrnd (1, 2)), "double") -***** assert (class (gamrnd (single (1), 2)), "single") -***** assert (class (gamrnd (single ([1 1]), 2)), "single") -***** assert (class (gamrnd (1, single (2))), "single") -***** assert (class (gamrnd (1, single ([2 2]))), "single") -***** error gamrnd () -***** error gamrnd (1) -***** error gamrnd (ones (3), ones (2)) -***** error gamrnd (ones (2), ones (3)) -***** error gamrnd (i, 2) -***** error gamrnd (2, i) -***** error gamrnd (1,2, -1) -***** error gamrnd (1,2, ones (2)) -***** error gamrnd (1, 2, [2 -1 2]) -***** error gamrnd (1,2, 1, ones (2)) -***** error gamrnd (1,2, 1, -1) -***** error gamrnd (ones (2,2), 2, 3) -***** error gamrnd (ones (2,2), 2, [3, 2]) -***** error gamrnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/gaminv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/gaminv.m -***** shared x - x = [-1 0 0.63212055882855778 1 2]; -***** assert (gaminv (x, ones (1,5), ones (1,5)), [NaN 0 1 Inf NaN], eps) -***** assert (gaminv (x, 1, ones (1,5)), [NaN 0 1 Inf NaN], eps) -***** assert (gaminv (x, ones (1,5), 1), [NaN 0 1 Inf NaN], eps) -***** assert (gaminv (x, [1 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) -***** assert (gaminv (x, 1, [1 -Inf NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (gaminv ([x(1:2) NaN x(4:5)], 1, 1), [NaN 0 NaN Inf NaN]) -***** assert (gaminv ([x, NaN], 1, 1), [NaN 0 1 Inf NaN NaN], eps) -***** assert (gaminv (single ([x, NaN]), 1, 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** assert (gaminv ([x, NaN], single (1), 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** assert (gaminv ([x, NaN], 1, single (1)), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** error gaminv () -***** error gaminv (1) -***** error gaminv (1,2) -***** error gaminv (1,2,3,4) -***** error gaminv (ones (3), ones (2), ones (2)) -***** error gaminv (ones (2), ones (3), ones (2)) -***** error gaminv (ones (2), ones (2), ones (3)) -***** error gaminv (i, 2, 2) -***** error gaminv (2, i, 2) -***** error gaminv (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/frnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/frnd.m -***** assert (size (frnd (1,2)), [1, 1]) -***** assert (size (frnd (ones (2,1), 2)), [2, 1]) -***** assert (size (frnd (ones (2,2), 2)), [2, 2]) -***** assert (size (frnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (frnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (frnd (1, 2, 3)), [3, 3]) -***** assert (size (frnd (1, 2, [4 1])), [4, 1]) -***** assert (size (frnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (frnd (1, 2)), "double") -***** assert (class (frnd (single (1), 2)), "single") -***** assert (class (frnd (single ([1 1]), 2)), "single") -***** assert (class (frnd (1, single (2))), "single") -***** assert (class (frnd (1, single ([2 2]))), "single") -***** error frnd () -***** error frnd (1) -***** error frnd (ones (3), ones (2)) -***** error frnd (ones (2), ones (3)) -***** error frnd (i, 2) -***** error frnd (2, i) -***** error frnd (1,2, -1) -***** error frnd (1,2, ones (2)) -***** error frnd (1, 2, [2 -1 2]) -***** error frnd (1,2, 1, ones (2)) -***** error frnd (1,2, 1, -1) -***** error frnd (ones (2,2), 2, 3) -***** error frnd (ones (2,2), 2, [3, 2]) -***** error frnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/lognpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/lognpdf.m +[inst/distributions/gamcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/gamcdf.m ***** shared x,y - x = [-1 0 e Inf]; - y = [0, 0, 1/(e*sqrt(2*pi)) * exp(-1/2), 0]; -***** assert (lognpdf (x, zeros (1,4), ones (1,4)), y, eps) -***** assert (lognpdf (x, 0, ones (1,4)), y, eps) -***** assert (lognpdf (x, zeros (1,4), 1), y, eps) -***** assert (lognpdf (x, [0 1 NaN 0], 1), [0 0 NaN y(4)], eps) -***** assert (lognpdf (x, 0, [0 NaN Inf 1]), [NaN NaN NaN y(4)], eps) -***** assert (lognpdf ([x, NaN], 0, 1), [y, NaN], eps) -***** assert (lognpdf (single ([x, NaN]), 0, 1), single ([y, NaN]), eps ("single")) -***** assert (lognpdf ([x, NaN], single (0), 1), single ([y, NaN]), eps ("single")) -***** assert (lognpdf ([x, NaN], 0, single (1)), single ([y, NaN]), eps ("single")) -***** error lognpdf () -***** error lognpdf (1,2) -***** error lognpdf (1,2,3,4) -***** error lognpdf (ones (3), ones (2), ones (2)) -***** error lognpdf (ones (2), ones (3), ones (2)) -***** error lognpdf (ones (2), ones (2), ones (3)) -***** error lognpdf (i, 2, 2) -***** error lognpdf (2, i, 2) -***** error lognpdf (2, 2, i) + x = [-1 0 0.5 1 2 Inf]; + y = [0, gammainc(x(2:end), 1)]; +***** assert (gamcdf (x, ones (1,6), ones (1,6)), y) +***** assert (gamcdf (x, 1, ones (1,6)), y) +***** assert (gamcdf (x, ones (1,6), 1), y) +***** assert (gamcdf (x, [0 -Inf NaN Inf 1 1], 1), [NaN NaN NaN NaN y(5:6)]) +***** assert (gamcdf (x, 1, [0 -Inf NaN Inf 1 1]), [NaN NaN NaN NaN y(5:6)]) +***** assert (gamcdf ([x(1:2) NaN x(4:6)], 1, 1), [y(1:2) NaN y(4:6)]) +***** assert (gamcdf ([x, NaN], 1, 1), [y, NaN]) +***** assert (gamcdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) +***** error gamcdf () +***** error gamcdf (1) +***** error gamcdf (1,2) +***** error gamcdf (1,2,3,4) +***** error gamcdf (ones (3), ones (2), ones (2)) +***** error gamcdf (ones (2), ones (3), ones (2)) +***** error gamcdf (ones (2), ones (2), ones (3)) +***** error gamcdf (i, 2, 2) +***** error gamcdf (2, i, 2) +***** error gamcdf (2, 2, i) 18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/fcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/fcdf.m +[inst/distributions/betacdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/betacdf.m ***** shared x,y - x = [-1 0 0.5 1 2 Inf]; - y = [0 0 1/3 1/2 2/3 1]; -***** assert (fcdf (x, 2*ones (1,6), 2*ones (1,6)), y, eps) -***** assert (fcdf (x, 2, 2*ones (1,6)), y, eps) -***** assert (fcdf (x, 2*ones (1,6), 2), y, eps) -***** assert (fcdf (x, [0 NaN Inf 2 2 2], 2), [NaN NaN NaN y(4:6)], eps) -***** assert (fcdf (x, 2, [0 NaN Inf 2 2 2]), [NaN NaN NaN y(4:6)], eps) -***** assert (fcdf ([x(1:2) NaN x(4:6)], 2, 2), [y(1:2) NaN y(4:6)], eps) -***** assert (fcdf ([x, NaN], 2, 2), [y, NaN], eps) -***** assert (fcdf (single ([x, NaN]), 2, 2), single ([y, NaN]), eps ("single")) -***** assert (fcdf ([x, NaN], single (2), 2), single ([y, NaN]), eps ("single")) -***** assert (fcdf ([x, NaN], 2, single (2)), single ([y, NaN]), eps ("single")) -***** error fcdf () -***** error fcdf (1) -***** error fcdf (1,2) -***** error fcdf (1,2,3,4) -***** error fcdf (ones (3), ones (2), ones (2)) -***** error fcdf (ones (2), ones (3), ones (2)) -***** error fcdf (ones (2), ones (2), ones (3)) -***** error fcdf (i, 2, 2) -***** error fcdf (2, i, 2) -***** error fcdf (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped + x = [-1 0 0.5 1 2]; + y = [0 0 0.75 1 1]; +***** assert (betacdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (betacdf (x, 1, 2*ones (1,5)), y) +***** assert (betacdf (x, ones (1,5), 2), y) +***** assert (betacdf (x, [0 1 NaN 1 1], 2), [NaN 0 NaN 1 1]) +***** assert (betacdf (x, 1, 2*[0 1 NaN 1 1]), [NaN 0 NaN 1 1]) +***** assert (betacdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) +***** assert (betacdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (betacdf (single ([x, NaN]), 1, 2), single ([y, NaN])) +***** assert (betacdf ([x, NaN], single (1), 2), single ([y, NaN])) +***** assert (betacdf ([x, NaN], 1, single (2)), single ([y, NaN])) +***** error betacdf () +***** error betacdf (1) +***** error betacdf (1,2) +***** error betacdf (1,2,3,4) +***** error betacdf (ones (3), ones (2), ones (2)) +***** error betacdf (ones (2), ones (3), ones (2)) +***** error betacdf (ones (2), ones (2), ones (3)) +17 tests, 17 passed, 0 known failure, 0 skipped [inst/distributions/cauchy_cdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_cdf.m ***** shared x,y @@ -6608,115 +5042,57 @@ ***** error cauchy_cdf (2, i, 2) ***** error cauchy_cdf (2, 2, i) 19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/binopdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/binopdf.m -***** shared x,y,tol - if (ismac ()) - tol = eps (); - else - tol = 0; - endif - x = [-1 0 1 2 3]; - y = [0 1/4 1/2 1/4 0]; -***** assert (binopdf (x, 2*ones (1,5), 0.5*ones (1,5)), y, tol) -***** assert (binopdf (x, 2, 0.5*ones (1,5)), y, tol) -***** assert (binopdf (x, 2*ones (1,5), 0.5), y, tol) -***** assert (binopdf (x, 2*[0 -1 NaN 1.1 1], 0.5), [0 NaN NaN NaN 0]) -***** assert (binopdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 0]) -***** assert (binopdf ([x, NaN], 2, 0.5), [y, NaN], tol) -***** assert (binopdf (0, 3, 0), 1) -***** assert (binopdf (2, 2, 1), 1) -***** assert (binopdf (1, 2, 1), 0) -***** assert (binopdf (single ([x, NaN]), 2, 0.5), single ([y, NaN])) -***** assert (binopdf ([x, NaN], single (2), 0.5), single ([y, NaN])) -***** assert (binopdf ([x, NaN], 2, single (0.5)), single ([y, NaN])) -***** error binopdf () -***** error binopdf (1) -***** error binopdf (1,2) -***** error binopdf (1,2,3,4) -***** error binopdf (ones (3), ones (2), ones (2)) -***** error binopdf (ones (2), ones (3), ones (2)) -***** error binopdf (ones (2), ones (2), ones (3)) -***** error binopdf (i, 2, 2) -***** error binopdf (2, i, 2) -***** error binopdf (2, 2, i) -22 tests, 22 passed, 0 known failure, 0 skipped -[inst/distributions/exprnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/exprnd.m -***** assert (size (exprnd (2)), [1, 1]) -***** assert (size (exprnd (ones (2,1))), [2, 1]) -***** assert (size (exprnd (ones (2,2))), [2, 2]) -***** assert (size (exprnd (1, 3)), [3, 3]) -***** assert (size (exprnd (1, [4 1])), [4, 1]) -***** assert (size (exprnd (1, 4, 1)), [4, 1]) -***** assert (class (exprnd (1)), "double") -***** assert (class (exprnd (single (1))), "single") -***** assert (class (exprnd (single ([1 1]))), "single") -***** error exprnd () -***** error exprnd (1, -1) -***** error exprnd (1, ones (2)) -***** error exprnd (i) -***** error exprnd (1, [2 -1 2]) -***** error exprnd (1, 2, -1) -***** error exprnd (1, 2, ones (2)) -***** error exprnd (ones (2,2), 3) -***** error exprnd (ones (2,2), [3, 2]) -***** error exprnd (ones (2,2), 2, 3) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/betarnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/betarnd.m -***** assert (size (betarnd (1,2)), [1, 1]) -***** assert (size (betarnd (ones (2,1), 2)), [2, 1]) -***** assert (size (betarnd (ones (2,2), 2)), [2, 2]) -***** assert (size (betarnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (betarnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (betarnd (1, 2, 3)), [3, 3]) -***** assert (size (betarnd (1, 2, [4 1])), [4, 1]) -***** assert (size (betarnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (betarnd (1, 2)), "double") -***** assert (class (betarnd (single (1), 2)), "single") -***** assert (class (betarnd (single ([1 1]), 2)), "single") -***** assert (class (betarnd (1, single (2))), "single") -***** assert (class (betarnd (1, single ([2 2]))), "single") -***** error betarnd () -***** error betarnd (1) -***** error betarnd (ones (3), ones (2)) -***** error betarnd (ones (2), ones (3)) -***** error betarnd (i, 2) -***** error betarnd (2, i) -***** error betarnd (1,2, -1) -***** error betarnd (1,2, ones (2)) -***** error binornd (1,2, [2 -1 2]) -***** error betarnd (1,2, 1, ones (2)) -***** error betarnd (1,2, 1, -1) -***** error betarnd (ones (2,2), 2, 3) -***** error betarnd (ones (2,2), 2, [3, 2]) -***** error betarnd (ones (2,2), 2, 2, 3) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/normpdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/normpdf.m +[inst/distributions/betainv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/betainv.m +***** shared x + x = [-1 0 0.75 1 2]; +***** assert (betainv (x, ones (1,5), 2*ones (1,5)), [NaN 0 0.5 1 NaN], eps) +***** assert (betainv (x, 1, 2*ones (1,5)), [NaN 0 0.5 1 NaN], eps) +***** assert (betainv (x, ones (1,5), 2), [NaN 0 0.5 1 NaN], eps) +***** assert (betainv (x, [1 0 NaN 1 1], 2), [NaN NaN NaN 1 NaN]) +***** assert (betainv (x, 1, 2*[1 0 NaN 1 1]), [NaN NaN NaN 1 NaN]) +***** assert (betainv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 0 NaN 1 NaN]) +***** assert (betainv ([x, NaN], 1, 2), [NaN 0 0.5 1 NaN NaN], eps) +***** assert (betainv (single ([x, NaN]), 1, 2), single ([NaN 0 0.5 1 NaN NaN])) +***** assert (betainv ([x, NaN], single (1), 2), single ([NaN 0 0.5 1 NaN NaN]), eps("single")) +***** assert (betainv ([x, NaN], 1, single (2)), single ([NaN 0 0.5 1 NaN NaN]), eps("single")) +***** error betainv () +***** error betainv (1) +***** error betainv (1,2) +***** error betainv (1,2,3,4) +***** error betainv (ones (3), ones (2), ones (2)) +***** error betainv (ones (2), ones (3), ones (2)) +***** error betainv (ones (2), ones (2), ones (3)) +***** error betainv (i, 2, 2) +***** error betainv (2, i, 2) +***** error betainv (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/distributions/fcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/fcdf.m ***** shared x,y - x = [-Inf 1 2 Inf]; - y = 1/sqrt(2*pi)*exp (-(x-1).^2/2); -***** assert (normpdf (x, ones (1,4), ones (1,4)), y, eps) -***** assert (normpdf (x, 1, ones (1,4)), y, eps) -***** assert (normpdf (x, ones (1,4), 1), y, eps) -***** assert (normpdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN], eps) -***** assert (normpdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN], eps) -***** assert (normpdf ([x, NaN], 1, 1), [y, NaN], eps) -***** assert (normpdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) -***** assert (normpdf ([x, NaN], single (1), 1), single ([y, NaN]), eps ("single")) -***** assert (normpdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps ("single")) -***** error normpdf () -***** error normpdf (1,2) -***** error normpdf (1,2,3,4) -***** error normpdf (ones (3), ones (2), ones (2)) -***** error normpdf (ones (2), ones (3), ones (2)) -***** error normpdf (ones (2), ones (2), ones (3)) -***** error normpdf (i, 2, 2) -***** error normpdf (2, i, 2) -***** error normpdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped + x = [-1 0 0.5 1 2 Inf]; + y = [0 0 1/3 1/2 2/3 1]; +***** assert (fcdf (x, 2*ones (1,6), 2*ones (1,6)), y, eps) +***** assert (fcdf (x, 2, 2*ones (1,6)), y, eps) +***** assert (fcdf (x, 2*ones (1,6), 2), y, eps) +***** assert (fcdf (x, [0 NaN Inf 2 2 2], 2), [NaN NaN NaN y(4:6)], eps) +***** assert (fcdf (x, 2, [0 NaN Inf 2 2 2]), [NaN NaN NaN y(4:6)], eps) +***** assert (fcdf ([x(1:2) NaN x(4:6)], 2, 2), [y(1:2) NaN y(4:6)], eps) +***** assert (fcdf ([x, NaN], 2, 2), [y, NaN], eps) +***** assert (fcdf (single ([x, NaN]), 2, 2), single ([y, NaN]), eps ("single")) +***** assert (fcdf ([x, NaN], single (2), 2), single ([y, NaN]), eps ("single")) +***** assert (fcdf ([x, NaN], 2, single (2)), single ([y, NaN]), eps ("single")) +***** error fcdf () +***** error fcdf (1) +***** error fcdf (1,2) +***** error fcdf (1,2,3,4) +***** error fcdf (ones (3), ones (2), ones (2)) +***** error fcdf (ones (2), ones (3), ones (2)) +***** error fcdf (ones (2), ones (2), ones (3)) +***** error fcdf (i, 2, 2) +***** error fcdf (2, i, 2) +***** error fcdf (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped [inst/distributions/tpdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/tpdf.m ***** test @@ -6740,37 +5116,134 @@ ***** error tpdf (i, 2) ***** error tpdf (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/binoinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/binoinv.m +[inst/distributions/betapdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/betapdf.m +***** shared x,y + x = [-1 0 0.5 1 2]; + y = [0 2 1 0 0]; +***** assert (betapdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (betapdf (x, 1, 2*ones (1,5)), y) +***** assert (betapdf (x, ones (1,5), 2), y) +***** assert (betapdf (x, [0 NaN 1 1 1], 2), [NaN NaN y(3:5)]) +***** assert (betapdf (x, 1, 2*[0 NaN 1 1 1]), [NaN NaN y(3:5)]) +***** assert (betapdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (betapdf (single ([x, NaN]), 1, 2), single ([y, NaN])) +***** assert (betapdf ([x, NaN], single (1), 2), single ([y, NaN])) +***** assert (betapdf ([x, NaN], 1, single (2)), single ([y, NaN])) +***** test + x = rand (10,1); + y = 1./(pi * sqrt (x.*(1-x))); + assert (betapdf (x, 1/2, 1/2), y, 50*eps); +***** assert (betapdf (0.5, 1000, 1000), 35.678, 1e-3) +***** error betapdf () +***** error betapdf (1) +***** error betapdf (1,2) +***** error betapdf (1,2,3,4) +***** error betapdf (ones (3), ones (2), ones (2)) +***** error betapdf (ones (2), ones (3), ones (2)) +***** error betapdf (ones (2), ones (2), ones (3)) +***** error betapdf (i, 2, 2) +***** error betapdf (2, i, 2) +***** error betapdf (2, 2, i) +21 tests, 21 passed, 0 known failure, 0 skipped +[inst/distributions/hygeinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/hygeinv.m ***** shared x x = [-1 0 0.5 1 2]; -***** assert (binoinv (x, 2*ones (1,5), 0.5*ones (1,5)), [NaN 0 1 2 NaN]) -***** assert (binoinv (x, 2, 0.5*ones (1,5)), [NaN 0 1 2 NaN]) -***** assert (binoinv (x, 2*ones (1,5), 0.5), [NaN 0 1 2 NaN]) -***** assert (binoinv (x, 2*[0 -1 NaN 1.1 1], 0.5), [NaN NaN NaN NaN NaN]) -***** assert (binoinv (x, 2, 0.5*[0 -1 NaN 3 1]), [NaN NaN NaN NaN NaN]) -***** assert (binoinv ([x(1:2) NaN x(4:5)], 2, 0.5), [NaN 0 NaN 2 NaN]) -***** assert (binoinv ([x, NaN], 2, 0.5), [NaN 0 1 2 NaN NaN]) -***** assert (binoinv (single ([x, NaN]), 2, 0.5), single ([NaN 0 1 2 NaN NaN])) -***** assert (binoinv ([x, NaN], single (2), 0.5), single ([NaN 0 1 2 NaN NaN])) -***** assert (binoinv ([x, NaN], 2, single (0.5)), single ([NaN 0 1 2 NaN NaN])) -***** shared y, tol - y = magic (3) + 1; - tol = 1; -***** assert (binoinv (binocdf (1:10, 11, 0.1), 11, 0.1), 1:10, tol) -***** assert (binoinv (binocdf (1:10, 2*(1:10), 0.1), 2*(1:10), 0.1), 1:10, tol) -***** assert (binoinv (binocdf (y, 2*y, 1./y), 2*y, 1./y), y, tol) -***** error binoinv () -***** error binoinv (1) -***** error binoinv (1,2) -***** error binoinv (1,2,3,4) -***** error binoinv (ones (3), ones (2), ones (2)) -***** error binoinv (ones (2), ones (3), ones (2)) -***** error binoinv (ones (2), ones (2), ones (3)) -***** error binoinv (i, 2, 2) -***** error binoinv (2, i, 2) -***** error binoinv (2, 2, i) -23 tests, 23 passed, 0 known failure, 0 skipped +***** assert (hygeinv (x, 4*ones (1,5), 2*ones (1,5), 2*ones (1,5)), [NaN 0 1 2 NaN]) +***** assert (hygeinv (x, 4*ones (1,5), 2, 2), [NaN 0 1 2 NaN]) +***** assert (hygeinv (x, 4, 2*ones (1,5), 2), [NaN 0 1 2 NaN]) +***** assert (hygeinv (x, 4, 2, 2*ones (1,5)), [NaN 0 1 2 NaN]) +***** assert (hygeinv (x, 4*[1 -1 NaN 1.1 1], 2, 2), [NaN NaN NaN NaN NaN]) +***** assert (hygeinv (x, 4, 2*[1 -1 NaN 1.1 1], 2), [NaN NaN NaN NaN NaN]) +***** assert (hygeinv (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) +***** assert (hygeinv (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [NaN NaN NaN NaN NaN]) +***** assert (hygeinv (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) +***** assert (hygeinv ([x(1:2) NaN x(4:5)], 4, 2, 2), [NaN 0 NaN 2 NaN]) +***** assert (hygeinv ([x, NaN], 4, 2, 2), [NaN 0 1 2 NaN NaN]) +***** assert (hygeinv (single ([x, NaN]), 4, 2, 2), single ([NaN 0 1 2 NaN NaN])) +***** assert (hygeinv ([x, NaN], single (4), 2, 2), single ([NaN 0 1 2 NaN NaN])) +***** assert (hygeinv ([x, NaN], 4, single (2), 2), single ([NaN 0 1 2 NaN NaN])) +***** assert (hygeinv ([x, NaN], 4, 2, single (2)), single ([NaN 0 1 2 NaN NaN])) +***** error hygeinv () +***** error hygeinv (1) +***** error hygeinv (1,2) +***** error hygeinv (1,2,3) +***** error hygeinv (1,2,3,4,5) +***** error hygeinv (ones (2), ones (3), 1, 1) +***** error hygeinv (1, ones (2), ones (3), 1) +***** error hygeinv (1, 1, ones (2), ones (3)) +***** error hygeinv (i, 2, 2, 2) +***** error hygeinv (2, i, 2, 2) +***** error hygeinv (2, 2, i, 2) +***** error hygeinv (2, 2, 2, i) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/nbinpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/nbinpdf.m +***** shared x,y + x = [-1 0 1 2 Inf]; + y = [0 1/2 1/4 1/8 NaN]; +***** assert (nbinpdf (x, ones (1,5), 0.5*ones (1,5)), y) +***** assert (nbinpdf (x, 1, 0.5*ones (1,5)), y) +***** assert (nbinpdf (x, ones (1,5), 0.5), y) +***** assert (nbinpdf (x, [0 1 NaN 1.5 Inf], 0.5), [NaN 1/2 NaN 1.875*0.5^1.5/4 NaN], eps) +***** assert (nbinpdf (x, 1, 0.5*[-1 NaN 4 1 1]), [NaN NaN NaN y(4:5)]) +***** assert (nbinpdf ([x, NaN], 1, 0.5), [y, NaN]) +***** assert (nbinpdf (single ([x, NaN]), 1, 0.5), single ([y, NaN])) +***** assert (nbinpdf ([x, NaN], single (1), 0.5), single ([y, NaN])) +***** assert (nbinpdf ([x, NaN], 1, single (0.5)), single ([y, NaN])) +***** error nbinpdf () +***** error nbinpdf (1) +***** error nbinpdf (1,2) +***** error nbinpdf (1,2,3,4) +***** error nbinpdf (ones (3), ones (2), ones (2)) +***** error nbinpdf (ones (2), ones (3), ones (2)) +***** error nbinpdf (ones (2), ones (2), ones (3)) +***** error nbinpdf (i, 2, 2) +***** error nbinpdf (2, i, 2) +***** error nbinpdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/lognrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/lognrnd.m +***** assert (size (lognrnd (1,2)), [1, 1]) +***** assert (size (lognrnd (ones (2,1), 2)), [2, 1]) +***** assert (size (lognrnd (ones (2,2), 2)), [2, 2]) +***** assert (size (lognrnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (lognrnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (lognrnd (1, 2, 3)), [3, 3]) +***** assert (size (lognrnd (1, 2, [4 1])), [4, 1]) +***** assert (size (lognrnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (lognrnd (1, 2)), "double") +***** assert (class (lognrnd (single (1), 2)), "single") +***** assert (class (lognrnd (single ([1 1]), 2)), "single") +***** assert (class (lognrnd (1, single (2))), "single") +***** assert (class (lognrnd (1, single ([2 2]))), "single") +***** error lognrnd () +***** error lognrnd (1) +***** error lognrnd (ones (3), ones (2)) +***** error lognrnd (ones (2), ones (3)) +***** error lognrnd (i, 2) +***** error lognrnd (2, i) +***** error lognrnd (1,2, -1) +***** error lognrnd (1,2, ones (2)) +***** error lognrnd (1, 2, [2 -1 2]) +***** error lognrnd (1,2, 1, ones (2)) +***** error lognrnd (1,2, 1, -1) +***** error lognrnd (ones (2,2), 2, 3) +***** error lognrnd (ones (2,2), 2, [3, 2]) +***** error lognrnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/stdnormal_inv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_inv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (stdnormal_inv (x), [NaN -Inf 0 Inf NaN]) +***** assert (stdnormal_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) +***** assert (stdnormal_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) +***** error stdnormal_inv () +***** error stdnormal_inv (1,2) +***** error stdnormal_inv (i) +6 tests, 6 passed, 0 known failure, 0 skipped [inst/distributions/unidpdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/unidpdf.m ***** shared x,y @@ -6790,6 +5263,296 @@ ***** error unidpdf (i, 2) ***** error unidpdf (2, i) 13 tests, 13 passed, 0 known failure, 0 skipped +[inst/distributions/normcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/normcdf.m +***** shared x,y + x = [-Inf 1 2 Inf]; + y = [0, 0.5, 1/2*(1+erf(1/sqrt(2))), 1]; +***** assert (normcdf (x, ones (1,4), ones (1,4)), y) +***** assert (normcdf (x, 1, ones (1,4)), y) +***** assert (normcdf (x, ones (1,4), 1), y) +***** assert (normcdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN]) +***** assert (normcdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN]) +***** assert (normcdf ([x(1:2) NaN x(4)], 1, 1), [y(1:2) NaN y(4)]) +***** assert (normcdf ([x, NaN], 1, 1), [y, NaN]) +***** assert (normcdf (single ([x, NaN]), 1, 1), single ([y, NaN]), eps ("single")) +***** assert (normcdf ([x, NaN], single (1), 1), single ([y, NaN]), eps ("single")) +***** assert (normcdf ([x, NaN], 1, single (1)), single ([y, NaN]), eps ("single")) +***** error normcdf () +***** error normcdf (1,2) +***** error normcdf (1,2,3,4) +***** error normcdf (ones (3), ones (2), ones (2)) +***** error normcdf (ones (2), ones (3), ones (2)) +***** error normcdf (ones (2), ones (2), ones (3)) +***** error normcdf (i, 2, 2) +***** error normcdf (2, i, 2) +***** error normcdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/unifcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unifcdf.m +***** shared x,y + x = [-1 0 0.5 1 2] + 1; + y = [0 0 0.5 1 1]; +***** assert (unifcdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (unifcdf (x, 1, 2*ones (1,5)), y) +***** assert (unifcdf (x, ones (1,5), 2), y) +***** assert (unifcdf (x, [2 1 NaN 1 1], 2), [NaN 0 NaN 1 1]) +***** assert (unifcdf (x, 1, 2*[0 1 NaN 1 1]), [NaN 0 NaN 1 1]) +***** assert (unifcdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) +***** assert (unifcdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (unifcdf (single ([x, NaN]), 1, 2), single ([y, NaN])) +***** assert (unifcdf ([x, NaN], single (1), 2), single ([y, NaN])) +***** assert (unifcdf ([x, NaN], 1, single (2)), single ([y, NaN])) +***** error unifcdf () +***** error unifcdf (1,2) +***** error unifcdf (1,2,3,4) +***** error unifcdf (ones (3), ones (2), ones (2)) +***** error unifcdf (ones (2), ones (3), ones (2)) +***** error unifcdf (ones (2), ones (2), ones (3)) +***** error unifcdf (i, 2, 2) +***** error unifcdf (2, i, 2) +***** error unifcdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/cauchy_pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_pdf.m +***** shared x,y + x = [-1 0 0.5 1 2]; + y = 1/pi * ( 2 ./ ((x-1).^2 + 2^2) ); +***** assert (cauchy_pdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (cauchy_pdf (x, 1, 2*ones (1,5)), y) +***** assert (cauchy_pdf (x, ones (1,5), 2), y) +***** assert (cauchy_pdf (x, [-Inf 1 NaN 1 Inf], 2), [NaN y(2) NaN y(4) NaN]) +***** assert (cauchy_pdf (x, 1, 2*[0 1 NaN 1 Inf]), [NaN y(2) NaN y(4) NaN]) +***** assert (cauchy_pdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (cauchy_pdf (single ([x, NaN]), 1, 2), single ([y, NaN]), eps ("single")) +***** assert (cauchy_pdf ([x, NaN], single (1), 2), single ([y, NaN]), eps ("single")) +***** assert (cauchy_pdf ([x, NaN], 1, single (2)), single ([y, NaN]), eps ("single")) +***** test + x = rand (10, 1); + assert (cauchy_pdf (x, 0, 1), tpdf (x, 1), eps); +***** error cauchy_pdf () +***** error cauchy_pdf (1,2) +***** error cauchy_pdf (1,2,3,4) +***** error cauchy_pdf (ones (3), ones (2), ones (2)) +***** error cauchy_pdf (ones (2), ones (3), ones (2)) +***** error cauchy_pdf (ones (2), ones (2), ones (3)) +***** error cauchy_pdf (i, 2, 2) +***** error cauchy_pdf (2, i, 2) +***** error cauchy_pdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/logistic_inv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_inv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (logistic_inv (x), [NaN -Inf 0 Inf NaN]) +***** assert (logistic_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) +***** assert (logistic_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) +***** error logistic_inv () +***** error logistic_inv (1,2) +***** error logistic_inv (i) +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/distributions/unidrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unidrnd.m +***** assert (size (unidrnd (2)), [1, 1]) +***** assert (size (unidrnd (ones (2,1))), [2, 1]) +***** assert (size (unidrnd (ones (2,2))), [2, 2]) +***** assert (size (unidrnd (10, [4 1])), [4, 1]) +***** assert (size (unidrnd (10, 4, 1)), [4, 1]) +***** assert (class (unidrnd (2)), "double") +***** assert (class (unidrnd (single (2))), "single") +***** assert (class (unidrnd (single ([2 2]))), "single") +***** error unidrnd () +***** error unidrnd (10, [1;2;3]) +***** error unidrnd (10, 2, ones (2)) +***** error unidrnd (10*ones (2), 2, 1) +***** error unidrnd (i) +13 tests, 13 passed, 0 known failure, 0 skipped +[inst/distributions/trnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/trnd.m +***** assert (size (trnd (2)), [1, 1]) +***** assert (size (trnd (ones (2,1))), [2, 1]) +***** assert (size (trnd (ones (2,2))), [2, 2]) +***** assert (size (trnd (1, 3)), [3, 3]) +***** assert (size (trnd (1, [4 1])), [4, 1]) +***** assert (size (trnd (1, 4, 1)), [4, 1]) +***** assert (class (trnd (1)), "double") +***** assert (class (trnd (single (1))), "single") +***** assert (class (trnd (single ([1 1]))), "single") +***** error trnd () +***** error trnd (1, -1) +***** error trnd (1, ones (2)) +***** error trnd (i) +***** error trnd (1, [2 -1 2]) +***** error trnd (1, 2, ones (2)) +***** error trnd (1, 2, -1) +***** error trnd (ones (2,2), 3) +***** error trnd (ones (2,2), [3, 2]) +***** error trnd (ones (2,2), 2, 3) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/laplace_pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_pdf.m +***** shared x,y + x = [-Inf -log(2) 0 log(2) Inf]; + y = [0, 1/4, 1/2, 1/4, 0]; +***** assert (laplace_pdf ([x, NaN]), [y, NaN]) +***** assert (laplace_pdf (single ([x, NaN])), single ([y, NaN])) +***** error laplace_pdf () +***** error laplace_pdf (1,2) +***** error laplace_pdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/logistic_pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_pdf.m +***** shared x,y + x = [-Inf -log(4) 0 log(4) Inf]; + y = [0, 0.16, 1/4, 0.16, 0]; +***** assert (logistic_pdf ([x, NaN]), [y, NaN], eps) +***** assert (logistic_pdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) +***** error logistic_pdf () +***** error logistic_pdf (1,2) +***** error logistic_pdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/hygecdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/hygecdf.m +***** shared x,y + x = [-1 0 1 2 3]; + y = [0 1/6 5/6 1 1]; +***** assert (hygecdf (x, 4*ones (1,5), 2, 2), y, eps) +***** assert (hygecdf (x, 4, 2*ones (1,5), 2), y, eps) +***** assert (hygecdf (x, 4, 2, 2*ones (1,5)), y, eps) +***** assert (hygecdf (x, 4*[1 -1 NaN 1.1 1], 2, 2), [y(1) NaN NaN NaN y(5)], eps) +***** assert (hygecdf (x, 4, 2*[1 -1 NaN 1.1 1], 2), [y(1) NaN NaN NaN y(5)], eps) +***** assert (hygecdf (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) +***** assert (hygecdf (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [y(1) NaN NaN NaN y(5)], eps) +***** assert (hygecdf (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) +***** assert (hygecdf ([x(1:2) NaN x(4:5)], 4, 2, 2), [y(1:2) NaN y(4:5)], eps) +***** assert (hygecdf ([x, NaN], 4, 2, 2), [y, NaN], eps) +***** assert (hygecdf (single ([x, NaN]), 4, 2, 2), single ([y, NaN]), eps ("single")) +***** assert (hygecdf ([x, NaN], single (4), 2, 2), single ([y, NaN]), eps ("single")) +***** assert (hygecdf ([x, NaN], 4, single (2), 2), single ([y, NaN]), eps ("single")) +***** assert (hygecdf ([x, NaN], 4, 2, single (2)), single ([y, NaN]), eps ("single")) +***** error hygecdf () +***** error hygecdf (1) +***** error hygecdf (1,2) +***** error hygecdf (1,2,3) +***** error hygecdf (1,2,3,4,5) +***** error hygecdf (ones (2), ones (3), 1, 1) +***** error hygecdf (1, ones (2), ones (3), 1) +***** error hygecdf (1, 1, ones (2), ones (3)) +***** error hygecdf (i, 2, 2, 2) +***** error hygecdf (2, i, 2, 2) +***** error hygecdf (2, 2, i, 2) +***** error hygecdf (2, 2, 2, i) +26 tests, 26 passed, 0 known failure, 0 skipped +[inst/distributions/tcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/tcdf.m +***** shared x,y + x = [-Inf 0 1 Inf]; + y = [0 1/2 3/4 1]; +***** assert (tcdf (x, ones (1,4)), y, eps) +***** assert (tcdf (x, 1), y, eps) +***** assert (tcdf (x, [0 1 NaN 1]), [NaN 1/2 NaN 1], eps) +***** assert (tcdf ([x(1:2) NaN x(4)], 1), [y(1:2) NaN y(4)], eps) +***** assert (tcdf ([x, NaN], 1), [y, NaN], eps) +***** assert (tcdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) +***** assert (tcdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) +***** error tcdf () +***** error tcdf (1) +***** error tcdf (1,2,3) +***** error tcdf (ones (3), ones (2)) +***** error tcdf (ones (2), ones (3)) +***** error tcdf (i, 2) +***** error tcdf (2, i) +***** shared tol_rel + tol_rel = 10 * eps; +***** assert (tcdf (10^(-10), 2.5), 0.50000000003618087, -tol_rel) +***** assert (tcdf (10^(-11), 2.5), 0.50000000000361809, -tol_rel) +***** assert (tcdf (10^(-12), 2.5), 0.50000000000036181, -tol_rel) +***** assert (tcdf (10^(-13), 2.5), 0.50000000000003618, -tol_rel) +***** assert (tcdf (10^(-14), 2.5), 0.50000000000000362, -tol_rel) +***** assert (tcdf (10^(-15), 2.5), 0.50000000000000036, -tol_rel) +***** assert (tcdf (10^(-16), 2.5), 0.50000000000000004, -tol_rel) +***** assert (tcdf (-10^1, 2.5), 2.2207478836537124e-03, -tol_rel) +***** assert (tcdf (-10^2, 2.5), 7.1916492116661878e-06, -tol_rel) +***** assert (tcdf (-10^3, 2.5), 2.2747463948307452e-08, -tol_rel) +***** assert (tcdf (-10^4, 2.5), 7.1933970159922115e-11, -tol_rel) +***** assert (tcdf (-10^5, 2.5), 2.2747519231756221e-13, -tol_rel) +26 tests, 26 passed, 0 known failure, 0 skipped +[inst/distributions/poissrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/poissrnd.m +***** assert (size (poissrnd (2)), [1, 1]) +***** assert (size (poissrnd (ones (2,1))), [2, 1]) +***** assert (size (poissrnd (ones (2,2))), [2, 2]) +***** assert (size (poissrnd (1, 3)), [3, 3]) +***** assert (size (poissrnd (1, [4 1])), [4, 1]) +***** assert (size (poissrnd (1, 4, 1)), [4, 1]) +***** assert (class (poissrnd (2)), "double") +***** assert (class (poissrnd (single (2))), "single") +***** assert (class (poissrnd (single ([2 2]))), "single") +***** error poissrnd () +***** error poissrnd (1, -1) +***** error poissrnd (1, ones (2)) +***** error poissrnd (1, 2, ones (2)) +***** error poissrnd (i) +***** error poissrnd (1, 2, -1) +***** error poissrnd (1, [2 -1 2]) +***** error poissrnd (ones (2,2), 3) +***** error poissrnd (ones (2,2), [3, 2]) +***** error poissrnd (ones (2,2), 2, 3) +***** assert (poissrnd (0, 1, 1), 0) +***** assert (poissrnd ([0, 0, 0], [1, 3]), [0 0 0]) +21 tests, 21 passed, 0 known failure, 0 skipped +[inst/distributions/chi2rnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2rnd.m +***** assert (size (chi2rnd (2)), [1, 1]) +***** assert (size (chi2rnd (ones (2,1))), [2, 1]) +***** assert (size (chi2rnd (ones (2,2))), [2, 2]) +***** assert (size (chi2rnd (1, 3)), [3, 3]) +***** assert (size (chi2rnd (1, [4 1])), [4, 1]) +***** assert (size (chi2rnd (1, 4, 1)), [4, 1]) +***** assert (class (chi2rnd (2)), "double") +***** assert (class (chi2rnd (single (2))), "single") +***** assert (class (chi2rnd (single ([2 2]))), "single") +***** error chi2rnd () +***** error chi2rnd (ones (3), ones (2)) +***** error chi2rnd (ones (2), ones (3)) +***** error chi2rnd (i) +***** error chi2rnd (1, -1) +***** error chi2rnd (1, ones (2)) +***** error chi2rnd (1, [2 -1 2]) +***** error chi2rnd (ones (2,2), 3) +***** error chi2rnd (ones (2,2), [3, 2]) +***** error chi2rnd (ones (2,2), 2, 3) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/normrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/normrnd.m +***** assert (size (normrnd (1,2)), [1, 1]) +***** assert (size (normrnd (ones (2,1), 2)), [2, 1]) +***** assert (size (normrnd (ones (2,2), 2)), [2, 2]) +***** assert (size (normrnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (normrnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (normrnd (1, 2, 3)), [3, 3]) +***** assert (size (normrnd (1, 2, [4 1])), [4, 1]) +***** assert (size (normrnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (normrnd (1, 2)), "double") +***** assert (class (normrnd (single (1), 2)), "single") +***** assert (class (normrnd (single ([1 1]), 2)), "single") +***** assert (class (normrnd (1, single (2))), "single") +***** assert (class (normrnd (1, single ([2 2]))), "single") +***** error normrnd () +***** error normrnd (1) +***** error normrnd (ones (3), ones (2)) +***** error normrnd (ones (2), ones (3)) +***** error normrnd (i, 2) +***** error normrnd (2, i) +***** error normrnd (1,2, -1) +***** error normrnd (1,2, ones (2)) +***** error normrnd (1, 2, [2 -1 2]) +***** error normrnd (1,2, 1, ones (2)) +***** error normrnd (1,2, 1, -1) +***** error normrnd (ones (2,2), 2, 3) +***** error normrnd (ones (2,2), 2, [3, 2]) +***** error normrnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped [inst/distributions/hygernd.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/hygernd.m ***** assert (size (hygernd (4,2,2)), [1, 1]) @@ -6825,191 +5588,148 @@ ***** error hygernd (4*ones (2),2,2, [3, 2]) ***** error hygernd (4*ones (2),2,2, 3, 2) 32 tests, 32 passed, 0 known failure, 0 skipped -[inst/distributions/logistic_pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_pdf.m -***** shared x,y - x = [-Inf -log(4) 0 log(4) Inf]; - y = [0, 0.16, 1/4, 0.16, 0]; -***** assert (logistic_pdf ([x, NaN]), [y, NaN], eps) -***** assert (logistic_pdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) -***** error logistic_pdf () -***** error logistic_pdf (1,2) -***** error logistic_pdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/nbincdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/nbincdf.m +[inst/distributions/frnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/frnd.m +***** assert (size (frnd (1,2)), [1, 1]) +***** assert (size (frnd (ones (2,1), 2)), [2, 1]) +***** assert (size (frnd (ones (2,2), 2)), [2, 2]) +***** assert (size (frnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (frnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (frnd (1, 2, 3)), [3, 3]) +***** assert (size (frnd (1, 2, [4 1])), [4, 1]) +***** assert (size (frnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (frnd (1, 2)), "double") +***** assert (class (frnd (single (1), 2)), "single") +***** assert (class (frnd (single ([1 1]), 2)), "single") +***** assert (class (frnd (1, single (2))), "single") +***** assert (class (frnd (1, single ([2 2]))), "single") +***** error frnd () +***** error frnd (1) +***** error frnd (ones (3), ones (2)) +***** error frnd (ones (2), ones (3)) +***** error frnd (i, 2) +***** error frnd (2, i) +***** error frnd (1,2, -1) +***** error frnd (1,2, ones (2)) +***** error frnd (1, 2, [2 -1 2]) +***** error frnd (1,2, 1, ones (2)) +***** error frnd (1,2, 1, -1) +***** error frnd (ones (2,2), 2, 3) +***** error frnd (ones (2,2), 2, [3, 2]) +***** error frnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/unidcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unidcdf.m ***** shared x,y - x = [-1 0 1 2 Inf]; - y = [0 1/2 3/4 7/8 1]; -***** assert (nbincdf (x, ones (1,5), 0.5*ones (1,5)), y) -***** assert (nbincdf (x, 1, 0.5*ones (1,5)), y) -***** assert (nbincdf (x, ones (1,5), 0.5), y) -***** assert (nbincdf ([x(1:3) 0 x(5)], [0 1 NaN 1.5 Inf], 0.5), [NaN 1/2 NaN nbinpdf(0,1.5,0.5) NaN], eps) -***** assert (nbincdf (x, 1, 0.5*[-1 NaN 4 1 1]), [NaN NaN NaN y(4:5)]) -***** assert (nbincdf ([x(1:2) NaN x(4:5)], 1, 0.5), [y(1:2) NaN y(4:5)]) -***** assert (nbincdf ([x, NaN], 1, 0.5), [y, NaN]) -***** assert (nbincdf (single ([x, NaN]), 1, 0.5), single ([y, NaN])) -***** assert (nbincdf ([x, NaN], single (1), 0.5), single ([y, NaN])) -***** assert (nbincdf ([x, NaN], 1, single (0.5)), single ([y, NaN])) -***** error nbincdf () -***** error nbincdf (1) -***** error nbincdf (1,2) -***** error nbincdf (1,2,3,4) -***** error nbincdf (ones (3), ones (2), ones (2)) -***** error nbincdf (ones (2), ones (3), ones (2)) -***** error nbincdf (ones (2), ones (2), ones (3)) -***** error nbincdf (i, 2, 2) -***** error nbincdf (2, i, 2) -***** error nbincdf (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/geoinv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/geoinv.m -***** shared x - x = [-1 0 0.75 1 2]; -***** assert (geoinv (x, 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (geoinv (x, 0.5), [NaN 0 1 Inf NaN]) -***** assert (geoinv (x, 0.5*[1 -1 NaN 4 1]), [NaN NaN NaN NaN NaN]) -***** assert (geoinv ([x(1:2) NaN x(4:5)], 0.5), [NaN 0 NaN Inf NaN]) -***** assert (geoinv ([x, NaN], 0.5), [NaN 0 1 Inf NaN NaN]) -***** assert (geoinv (single ([x, NaN]), 0.5), single ([NaN 0 1 Inf NaN NaN])) -***** assert (geoinv ([x, NaN], single (0.5)), single ([NaN 0 1 Inf NaN NaN])) -***** error geoinv () -***** error geoinv (1) -***** error geoinv (1,2,3) -***** error geoinv (ones (3), ones (2)) -***** error geoinv (ones (2), ones (3)) -***** error geoinv (i, 2) -***** error geoinv (2, i) + x = [0 1 2.5 10 11]; + y = [0, 0.1 0.2 1.0 1.0]; +***** assert (unidcdf (x, 10*ones (1,5)), y) +***** assert (unidcdf (x, 10), y) +***** assert (unidcdf (x, 10*[0 1 NaN 1 1]), [NaN 0.1 NaN y(4:5)]) +***** assert (unidcdf ([x(1:2) NaN Inf x(5)], 10), [y(1:2) NaN 1 y(5)]) +***** assert (unidcdf ([x, NaN], 10), [y, NaN]) +***** assert (unidcdf (single ([x, NaN]), 10), single ([y, NaN])) +***** assert (unidcdf ([x, NaN], single (10)), single ([y, NaN])) +***** error unidcdf () +***** error unidcdf (1) +***** error unidcdf (1,2,3) +***** error unidcdf (ones (3), ones (2)) +***** error unidcdf (ones (2), ones (3)) +***** error unidcdf (i, 2) +***** error unidcdf (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/wblcdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/wblcdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = [0, 1-exp(-x(2:4)), 1]; -***** assert (wblcdf (x, ones (1,5), ones (1,5)), y) -***** assert (wblcdf (x, 1, ones (1,5)), y) -***** assert (wblcdf (x, ones (1,5), 1), y) -***** assert (wblcdf (x, [0 1 NaN Inf 1], 1), [NaN 0 NaN NaN 1]) -***** assert (wblcdf (x, 1, [0 1 NaN Inf 1]), [NaN 0 NaN NaN 1]) -***** assert (wblcdf ([x(1:2) NaN x(4:5)], 1, 1), [y(1:2) NaN y(4:5)]) -***** assert (wblcdf ([x, NaN], 1, 1), [y, NaN]) -***** assert (wblcdf (single ([x, NaN]), 1, 1), single ([y, NaN])) -***** assert (wblcdf ([x, NaN], single (1), 1), single ([y, NaN])) -***** assert (wblcdf ([x, NaN], 1, single (1)), single ([y, NaN])) -***** error wblcdf () -***** error wblcdf (1,2,3,4) -***** error wblcdf (ones (3), ones (2), ones (2)) -***** error wblcdf (ones (2), ones (3), ones (2)) -***** error wblcdf (ones (2), ones (2), ones (3)) -***** error wblcdf (i, 2, 2) -***** error wblcdf (2, i, 2) -***** error wblcdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/stdnormal_pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/stdnormal_pdf.m -***** shared x,y - x = [-Inf 0 1 Inf]; - y = 1/sqrt(2*pi)*exp (-x.^2/2); -***** assert (stdnormal_pdf ([x, NaN]), [y, NaN], eps) -***** assert (stdnormal_pdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) -***** error stdnormal_pdf () -***** error stdnormal_pdf (1,2) -***** error stdnormal_pdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/betainv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/betainv.m +[inst/distributions/logistic_rnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_rnd.m +***** assert (size (logistic_rnd (3)), [3, 3]) +***** assert (size (logistic_rnd ([4 1])), [4, 1]) +***** assert (size (logistic_rnd (4,1)), [4, 1]) +***** error logistic_rnd () +***** error logistic_rnd (-1) +***** error logistic_rnd (ones (2)) +***** error logistic_rnd ([2 -1 2]) +***** error logistic_rnd (1, ones (2)) +***** error logistic_rnd (1, -1) +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/distributions/binornd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/binornd.m +***** assert (binornd (0, 0, 1), 0) +***** assert (binornd ([0, 0], [0, 0], 1, 2), [0, 0]) +***** assert (size (binornd (2, 1/2)), [1, 1]) +***** assert (size (binornd (2*ones (2,1), 1/2)), [2, 1]) +***** assert (size (binornd (2*ones (2,2), 1/2)), [2, 2]) +***** assert (size (binornd (2, 1/2*ones (2,1))), [2, 1]) +***** assert (size (binornd (2, 1/2*ones (2,2))), [2, 2]) +***** assert (size (binornd (2, 1/2, 3)), [3, 3]) +***** assert (size (binornd (2, 1/2, [4 1])), [4, 1]) +***** assert (size (binornd (2, 1/2, 4, 1)), [4, 1]) +***** assert (class (binornd (2, 0.5)), "double") +***** assert (class (binornd (single (2), 0.5)), "single") +***** assert (class (binornd (single ([2 2]), 0.5)), "single") +***** assert (class (binornd (2, single (0.5))), "single") +***** assert (class (binornd (2, single ([0.5 0.5]))), "single") +***** error binornd () +***** error binornd (1) +***** error binornd (ones (3), ones (2)) +***** error binornd (ones (2), ones (3)) +***** error binornd (i, 2) +***** error binornd (2, i) +***** error binornd (1,2, -1) +***** error binornd (1,2, ones (2)) +***** error binornd (1,2, [2 -1 2]) +***** error binornd (1,2, 1, ones (2)) +***** error binornd (1,2, 1, -1) +***** error binornd (ones (2,2), 2, 3) +***** error binornd (ones (2,2), 2, [3, 2]) +***** error binornd (ones (2,2), 2, 2, 3) +29 tests, 29 passed, 0 known failure, 0 skipped +[inst/distributions/tinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/tinv.m ***** shared x - x = [-1 0 0.75 1 2]; -***** assert (betainv (x, ones (1,5), 2*ones (1,5)), [NaN 0 0.5 1 NaN], eps) -***** assert (betainv (x, 1, 2*ones (1,5)), [NaN 0 0.5 1 NaN], eps) -***** assert (betainv (x, ones (1,5), 2), [NaN 0 0.5 1 NaN], eps) -***** assert (betainv (x, [1 0 NaN 1 1], 2), [NaN NaN NaN 1 NaN]) -***** assert (betainv (x, 1, 2*[1 0 NaN 1 1]), [NaN NaN NaN 1 NaN]) -***** assert (betainv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 0 NaN 1 NaN]) -***** assert (betainv ([x, NaN], 1, 2), [NaN 0 0.5 1 NaN NaN], eps) -***** assert (betainv (single ([x, NaN]), 1, 2), single ([NaN 0 0.5 1 NaN NaN])) -***** assert (betainv ([x, NaN], single (1), 2), single ([NaN 0 0.5 1 NaN NaN]), eps("single")) -***** assert (betainv ([x, NaN], 1, single (2)), single ([NaN 0 0.5 1 NaN NaN]), eps("single")) -***** error betainv () -***** error betainv (1) -***** error betainv (1,2) -***** error betainv (1,2,3,4) -***** error betainv (ones (3), ones (2), ones (2)) -***** error betainv (ones (2), ones (3), ones (2)) -***** error betainv (ones (2), ones (2), ones (3)) -***** error betainv (i, 2, 2) -***** error betainv (2, i, 2) -***** error betainv (2, 2, i) -20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/poisscdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/poisscdf.m -***** shared x,y - x = [-1 0 1 2 Inf]; - y = [0, gammainc(1, (x(2:4) +1), "upper"), 1]; -***** assert (poisscdf (x, ones (1,5)), y) -***** assert (poisscdf (x, 1), y) -***** assert (poisscdf (x, [1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) -***** assert (poisscdf ([x(1:2) NaN Inf x(5)], 1), [y(1:2) NaN 1 y(5)]) -***** assert (poisscdf ([x, NaN], 1), [y, NaN]) -***** assert (poisscdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) -***** assert (poisscdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) -***** error poisscdf () -***** error poisscdf (1) -***** error poisscdf (1,2,3) -***** error poisscdf (ones (3), ones (2)) -***** error poisscdf (ones (2), ones (3)) -***** error poisscdf (i, 2) -***** error poisscdf (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/geocdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/geocdf.m -***** shared x,y - x = [-1 0 1 Inf]; - y = [0 0.5 0.75 1]; -***** assert (geocdf (x, 0.5*ones (1,4)), y) -***** assert (geocdf (x, 0.5), y) -***** assert (geocdf (x, 0.5*[-1 NaN 4 1]), [NaN NaN NaN y(4)]) -***** assert (geocdf ([x(1:2) NaN x(4)], 0.5), [y(1:2) NaN y(4)]) -***** assert (geocdf ([x, NaN], 0.5), [y, NaN]) -***** assert (geocdf (single ([x, NaN]), 0.5), single ([y, NaN])) -***** assert (geocdf ([x, NaN], single (0.5)), single ([y, NaN])) -***** error geocdf () -***** error geocdf (1) -***** error geocdf (1,2,3) -***** error geocdf (ones (3), ones (2)) -***** error geocdf (ones (2), ones (3)) -***** error geocdf (i, 2) -***** error geocdf (2, i) + x = [-1 0 0.5 1 2]; +***** assert (tinv (x, ones (1,5)), [NaN -Inf 0 Inf NaN]) +***** assert (tinv (x, 1), [NaN -Inf 0 Inf NaN], eps) +***** assert (tinv (x, [1 0 NaN 1 1]), [NaN NaN NaN Inf NaN], eps) +***** assert (tinv ([x(1:2) NaN x(4:5)], 1), [NaN -Inf NaN Inf NaN]) +***** assert (tinv ([x, NaN], 1), [NaN -Inf 0 Inf NaN NaN], eps) +***** assert (tinv (single ([x, NaN]), 1), single ([NaN -Inf 0 Inf NaN NaN]), eps ("single")) +***** assert (tinv ([x, NaN], single (1)), single ([NaN -Inf 0 Inf NaN NaN]), eps ("single")) +***** error tinv () +***** error tinv (1) +***** error tinv (1,2,3) +***** error tinv (ones (3), ones (2)) +***** error tinv (ones (2), ones (3)) +***** error tinv (i, 2) +***** error tinv (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/nbinrnd.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/nbinrnd.m -***** assert (size (nbinrnd (2, 1/2)), [1, 1]) -***** assert (size (nbinrnd (2*ones (2,1), 1/2)), [2, 1]) -***** assert (size (nbinrnd (2*ones (2,2), 1/2)), [2, 2]) -***** assert (size (nbinrnd (2, 1/2*ones (2,1))), [2, 1]) -***** assert (size (nbinrnd (2, 1/2*ones (2,2))), [2, 2]) -***** assert (size (nbinrnd (2, 1/2, 3)), [3, 3]) -***** assert (size (nbinrnd (2, 1/2, [4 1])), [4, 1]) -***** assert (size (nbinrnd (2, 1/2, 4, 1)), [4, 1]) -***** assert (class (nbinrnd (2, 1/2)), "double") -***** assert (class (nbinrnd (single (2), 1/2)), "single") -***** assert (class (nbinrnd (single ([2 2]), 1/2)), "single") -***** assert (class (nbinrnd (2, single (1/2))), "single") -***** assert (class (nbinrnd (2, single ([1/2 1/2]))), "single") -***** error nbinrnd () -***** error nbinrnd (1) -***** error nbinrnd (ones (3), ones (2)) -***** error nbinrnd (ones (2), ones (3)) -***** error nbinrnd (i, 2) -***** error nbinrnd (2, i) -***** error nbinrnd (1,2, -1) -***** error nbinrnd (1,2, ones (2)) -***** error nbinrnd (1, 2, [2 -1 2]) -***** error nbinrnd (1,2, 1, ones (2)) -***** error nbinrnd (1,2, 1, -1) -***** error nbinrnd (ones (2,2), 2, 3) -***** error nbinrnd (ones (2,2), 2, [3, 2]) -***** error nbinrnd (ones (2,2), 2, 2, 3) +[inst/distributions/cauchy_rnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_rnd.m +***** assert (size (cauchy_rnd (1,2)), [1, 1]) +***** assert (size (cauchy_rnd (ones (2,1), 2)), [2, 1]) +***** assert (size (cauchy_rnd (ones (2,2), 2)), [2, 2]) +***** assert (size (cauchy_rnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (cauchy_rnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (cauchy_rnd (1, 2, 3)), [3, 3]) +***** assert (size (cauchy_rnd (1, 2, [4 1])), [4, 1]) +***** assert (size (cauchy_rnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (cauchy_rnd (1, 2)), "double") +***** assert (class (cauchy_rnd (single (1), 2)), "single") +***** assert (class (cauchy_rnd (single ([1 1]), 2)), "single") +***** assert (class (cauchy_rnd (1, single (2))), "single") +***** assert (class (cauchy_rnd (1, single ([2 2]))), "single") +***** error cauchy_rnd () +***** error cauchy_rnd (1) +***** error cauchy_rnd (ones (3), ones (2)) +***** error cauchy_rnd (ones (2), ones (3)) +***** error cauchy_rnd (i, 2) +***** error cauchy_rnd (2, i) +***** error cauchy_rnd (1,2, -1) +***** error cauchy_rnd (1,2, ones (2)) +***** error cauchy_rnd (1,2, [2 -1 2]) +***** error cauchy_rnd (1,2, 1, ones (2)) +***** error cauchy_rnd (1,2, 1, -1) +***** error cauchy_rnd (ones (2,2), 2, 3) +***** error cauchy_rnd (ones (2,2), 2, [3, 2]) +***** error cauchy_rnd (ones (2,2), 2, 2, 3) 27 tests, 27 passed, 0 known failure, 0 skipped [inst/distributions/unifpdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/unifpdf.m @@ -7035,6 +5755,72 @@ ***** error unifpdf (2, i, 2) ***** error unifpdf (2, 2, i) 18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/logncdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logncdf.m +***** shared x,y + x = [-1 0 1 e Inf]; + y = [0, 0, 0.5, 1/2+1/2*erf(1/2), 1]; +***** assert (logncdf (x, zeros (1,5), sqrt(2)*ones (1,5)), y, eps) +***** assert (logncdf (x, 0, sqrt(2)*ones (1,5)), y, eps) +***** assert (logncdf (x, zeros (1,5), sqrt(2)), y, eps) +***** assert (logncdf (x, [0 1 NaN 0 1], sqrt(2)), [0 0 NaN y(4:5)], eps) +***** assert (logncdf (x, 0, sqrt(2)*[0 NaN Inf 1 1]), [NaN NaN NaN y(4:5)], eps) +***** assert (logncdf ([x(1:3) NaN x(5)], 0, sqrt(2)), [y(1:3) NaN y(5)], eps) +***** assert (logncdf ([x, NaN], 0, sqrt(2)), [y, NaN], eps) +***** assert (logncdf (single ([x, NaN]), 0, sqrt(2)), single ([y, NaN]), eps ("single")) +***** assert (logncdf ([x, NaN], single (0), sqrt(2)), single ([y, NaN]), eps ("single")) +***** assert (logncdf ([x, NaN], 0, single (sqrt(2))), single ([y, NaN]), eps ("single")) +***** error logncdf () +***** error logncdf (1,2) +***** error logncdf (1,2,3,4) +***** error logncdf (ones (3), ones (2), ones (2)) +***** error logncdf (ones (2), ones (3), ones (2)) +***** error logncdf (ones (2), ones (2), ones (3)) +***** error logncdf (i, 2, 2) +***** error logncdf (2, i, 2) +***** error logncdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/fpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/fpdf.m +***** test + x = rand (10,1); + x = x(x > 0.1 & x < 0.9); + y = tpdf (sqrt (x), 2) ./ sqrt (x); + assert (fpdf (x, 1, 2), y, 5*eps); +***** shared x,y + x = [-1 0 0.5 1 2]; + y = [0 0 4/9 1/4 1/9]; +***** assert (fpdf (x, 2*ones (1,5), 2*ones (1,5)), y, eps) +***** assert (fpdf (x, 2, 2*ones (1,5)), y, eps) +***** assert (fpdf (x, 2*ones (1,5), 2), y, eps) +***** assert (fpdf (x, [0 NaN Inf 2 2], 2), [NaN NaN NaN y(4:5)], eps) +***** assert (fpdf (x, 2, [0 NaN Inf 2 2]), [NaN NaN NaN y(4:5)], eps) +***** assert (fpdf ([x, NaN], 2, 2), [y, NaN], eps) +***** assert (fpdf (single ([x, NaN]), 2, 2), single ([y, NaN]), eps ("single")) +***** assert (fpdf ([x, NaN], single (2), 2), single ([y, NaN]), eps ("single")) +***** assert (fpdf ([x, NaN], 2, single (2)), single ([y, NaN]), eps ("single")) +***** error fpdf () +***** error fpdf (1) +***** error fpdf (1,2) +***** error fpdf (1,2,3,4) +***** error fpdf (ones (3), ones (2), ones (2)) +***** error fpdf (ones (2), ones (3), ones (2)) +***** error fpdf (ones (2), ones (2), ones (3)) +***** error fpdf (i, 2, 2) +***** error fpdf (2, i, 2) +***** error fpdf (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/distributions/laplace_inv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_inv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (laplace_inv (x), [NaN -Inf 0 Inf NaN]) +***** assert (laplace_inv ([x, NaN]), [NaN -Inf 0 Inf NaN NaN]) +***** assert (laplace_inv (single ([x, NaN])), single ([NaN -Inf 0 Inf NaN NaN])) +***** error laplace_inv () +***** error laplace_inv (1,2) +***** error laplace_inv (i) +6 tests, 6 passed, 0 known failure, 0 skipped [inst/distributions/wblpdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/wblpdf.m ***** shared x,y @@ -7058,6 +5844,228 @@ ***** error wblpdf (2, i, 2) ***** error wblpdf (2, 2, i) 17 tests, 17 passed, 0 known failure, 0 skipped +[inst/distributions/nbinrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/nbinrnd.m +***** assert (size (nbinrnd (2, 1/2)), [1, 1]) +***** assert (size (nbinrnd (2*ones (2,1), 1/2)), [2, 1]) +***** assert (size (nbinrnd (2*ones (2,2), 1/2)), [2, 2]) +***** assert (size (nbinrnd (2, 1/2*ones (2,1))), [2, 1]) +***** assert (size (nbinrnd (2, 1/2*ones (2,2))), [2, 2]) +***** assert (size (nbinrnd (2, 1/2, 3)), [3, 3]) +***** assert (size (nbinrnd (2, 1/2, [4 1])), [4, 1]) +***** assert (size (nbinrnd (2, 1/2, 4, 1)), [4, 1]) +***** assert (class (nbinrnd (2, 1/2)), "double") +***** assert (class (nbinrnd (single (2), 1/2)), "single") +***** assert (class (nbinrnd (single ([2 2]), 1/2)), "single") +***** assert (class (nbinrnd (2, single (1/2))), "single") +***** assert (class (nbinrnd (2, single ([1/2 1/2]))), "single") +***** error nbinrnd () +***** error nbinrnd (1) +***** error nbinrnd (ones (3), ones (2)) +***** error nbinrnd (ones (2), ones (3)) +***** error nbinrnd (i, 2) +***** error nbinrnd (2, i) +***** error nbinrnd (1,2, -1) +***** error nbinrnd (1,2, ones (2)) +***** error nbinrnd (1, 2, [2 -1 2]) +***** error nbinrnd (1,2, 1, ones (2)) +***** error nbinrnd (1,2, 1, -1) +***** error nbinrnd (ones (2,2), 2, 3) +***** error nbinrnd (ones (2,2), 2, [3, 2]) +***** error nbinrnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/logninv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logninv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (logninv (x, ones (1,5), ones (1,5)), [NaN 0 e Inf NaN]) +***** assert (logninv (x, 1, ones (1,5)), [NaN 0 e Inf NaN]) +***** assert (logninv (x, ones (1,5), 1), [NaN 0 e Inf NaN]) +***** assert (logninv (x, [1 1 NaN 0 1], 1), [NaN 0 NaN Inf NaN]) +***** assert (logninv (x, 1, [1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (logninv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 0 NaN Inf NaN]) +***** assert (logninv ([x, NaN], 1, 1), [NaN 0 e Inf NaN NaN]) +***** assert (logninv (single ([x, NaN]), 1, 1), single ([NaN 0 e Inf NaN NaN])) +***** assert (logninv ([x, NaN], single (1), 1), single ([NaN 0 e Inf NaN NaN])) +***** assert (logninv ([x, NaN], 1, single (1)), single ([NaN 0 e Inf NaN NaN])) +***** error logninv () +***** error logninv (1,2) +***** error logninv (1,2,3,4) +***** error logninv (ones (3), ones (2), ones (2)) +***** error logninv (ones (2), ones (3), ones (2)) +***** error logninv (ones (2), ones (2), ones (3)) +***** error logninv (i, 2, 2) +***** error logninv (2, i, 2) +***** error logninv (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped +[inst/distributions/logistic_cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/logistic_cdf.m +***** shared x,y + x = [-Inf -log(3) 0 log(3) Inf]; + y = [0, 1/4, 1/2, 3/4, 1]; +***** assert (logistic_cdf ([x, NaN]), [y, NaN], eps) +***** assert (logistic_cdf (single ([x, NaN])), single ([y, NaN]), eps ("single")) +***** error logistic_cdf () +***** error logistic_cdf (1,2) +***** error logistic_cdf (i) +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/distributions/poissinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/poissinv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (poissinv (x, ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (poissinv (x, 1), [NaN 0 1 Inf NaN]) +***** assert (poissinv (x, [1 0 NaN 1 1]), [NaN NaN NaN Inf NaN]) +***** assert (poissinv ([x(1:2) NaN x(4:5)], 1), [NaN 0 NaN Inf NaN]) +***** assert (poissinv ([x, NaN], 1), [NaN 0 1 Inf NaN NaN]) +***** assert (poissinv (single ([x, NaN]), 1), single ([NaN 0 1 Inf NaN NaN])) +***** assert (poissinv ([x, NaN], single (1)), single ([NaN 0 1 Inf NaN NaN])) +***** error poissinv () +***** error poissinv (1) +***** error poissinv (1,2,3) +***** error poissinv (ones (3), ones (2)) +***** error poissinv (ones (2), ones (3)) +***** error poissinv (i, 2) +***** error poissinv (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/chi2cdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2cdf.m +***** shared x,y + x = [-1 0 0.5 1 2]; + y = [0, 1 - exp(-x(2:end)/2)]; +***** assert (chi2cdf (x, 2*ones (1,5)), y, eps) +***** assert (chi2cdf (x, 2), y, eps) +***** assert (chi2cdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)], eps) +***** assert (chi2cdf ([x(1:2) NaN x(4:5)], 2), [y(1:2) NaN y(4:5)], eps) +***** assert (chi2cdf ([x, NaN], 2), [y, NaN], eps) +***** assert (chi2cdf (single ([x, NaN]), 2), single ([y, NaN]), eps ("single")) +***** assert (chi2cdf ([x, NaN], single (2)), single ([y, NaN]), eps ("single")) +***** error chi2cdf () +***** error chi2cdf (1) +***** error chi2cdf (1,2,3) +***** error chi2cdf (ones (3), ones (2)) +***** error chi2cdf (ones (2), ones (3)) +***** error chi2cdf (i, 2) +***** error chi2cdf (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/binopdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/binopdf.m +***** shared x,y,tol + if (ismac ()) + tol = eps (); + else + tol = 0; + endif + x = [-1 0 1 2 3]; + y = [0 1/4 1/2 1/4 0]; +***** assert (binopdf (x, 2*ones (1,5), 0.5*ones (1,5)), y, tol) +***** assert (binopdf (x, 2, 0.5*ones (1,5)), y, tol) +***** assert (binopdf (x, 2*ones (1,5), 0.5), y, tol) +***** assert (binopdf (x, 2*[0 -1 NaN 1.1 1], 0.5), [0 NaN NaN NaN 0]) +***** assert (binopdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 0]) +***** assert (binopdf ([x, NaN], 2, 0.5), [y, NaN], tol) +***** assert (binopdf (0, 3, 0), 1) +***** assert (binopdf (2, 2, 1), 1) +***** assert (binopdf (1, 2, 1), 0) +***** assert (binopdf (single ([x, NaN]), 2, 0.5), single ([y, NaN])) +***** assert (binopdf ([x, NaN], single (2), 0.5), single ([y, NaN])) +***** assert (binopdf ([x, NaN], 2, single (0.5)), single ([y, NaN])) +***** error binopdf () +***** error binopdf (1) +***** error binopdf (1,2) +***** error binopdf (1,2,3,4) +***** error binopdf (ones (3), ones (2), ones (2)) +***** error binopdf (ones (2), ones (3), ones (2)) +***** error binopdf (ones (2), ones (2), ones (3)) +***** error binopdf (i, 2, 2) +***** error binopdf (2, i, 2) +***** error binopdf (2, 2, i) +22 tests, 22 passed, 0 known failure, 0 skipped +[inst/distributions/chi2pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/chi2pdf.m +***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = [0, 1/2 * exp(-x(2:5)/2)]; +***** assert (chi2pdf (x, 2*ones (1,5)), y) +***** assert (chi2pdf (x, 2), y) +***** assert (chi2pdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) +***** assert (chi2pdf ([x, NaN], 2), [y, NaN]) +***** assert (chi2pdf (single ([x, NaN]), 2), single ([y, NaN])) +***** assert (chi2pdf ([x, NaN], single (2)), single ([y, NaN])) +***** error chi2pdf () +***** error chi2pdf (1) +***** error chi2pdf (1,2,3) +***** error chi2pdf (ones (3), ones (2)) +***** error chi2pdf (ones (2), ones (3)) +***** error chi2pdf (i, 2) +***** error chi2pdf (2, i) +13 tests, 13 passed, 0 known failure, 0 skipped +[inst/distributions/laplace_rnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_rnd.m +***** assert (size (laplace_rnd (3)), [3, 3]) +***** assert (size (laplace_rnd ([4 1])), [4, 1]) +***** assert (size (laplace_rnd (4,1)), [4, 1]) +***** error laplace_rnd () +***** error laplace_rnd (-1) +***** error laplace_rnd (ones (2)) +***** error laplace_rnd ([2 -1 2]) +***** error laplace_rnd (1, ones (2)) +***** error laplace_rnd (1, -1) +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/distributions/betarnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/betarnd.m +***** assert (size (betarnd (1,2)), [1, 1]) +***** assert (size (betarnd (ones (2,1), 2)), [2, 1]) +***** assert (size (betarnd (ones (2,2), 2)), [2, 2]) +***** assert (size (betarnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (betarnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (betarnd (1, 2, 3)), [3, 3]) +***** assert (size (betarnd (1, 2, [4 1])), [4, 1]) +***** assert (size (betarnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (betarnd (1, 2)), "double") +***** assert (class (betarnd (single (1), 2)), "single") +***** assert (class (betarnd (single ([1 1]), 2)), "single") +***** assert (class (betarnd (1, single (2))), "single") +***** assert (class (betarnd (1, single ([2 2]))), "single") +***** error betarnd () +***** error betarnd (1) +***** error betarnd (ones (3), ones (2)) +***** error betarnd (ones (2), ones (3)) +***** error betarnd (i, 2) +***** error betarnd (2, i) +***** error betarnd (1,2, -1) +***** error betarnd (1,2, ones (2)) +***** error binornd (1,2, [2 -1 2]) +***** error betarnd (1,2, 1, ones (2)) +***** error betarnd (1,2, 1, -1) +***** error betarnd (ones (2,2), 2, 3) +***** error betarnd (ones (2,2), 2, [3, 2]) +***** error betarnd (ones (2,2), 2, 2, 3) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/unifinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/unifinv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (unifinv (x, ones (1,5), 2*ones (1,5)), [NaN 1 1.5 2 NaN]) +***** assert (unifinv (x, 1, 2*ones (1,5)), [NaN 1 1.5 2 NaN]) +***** assert (unifinv (x, ones (1,5), 2), [NaN 1 1.5 2 NaN]) +***** assert (unifinv (x, [1 2 NaN 1 1], 2), [NaN NaN NaN 2 NaN]) +***** assert (unifinv (x, 1, 2*[1 0 NaN 1 1]), [NaN NaN NaN 2 NaN]) +***** assert (unifinv ([x(1:2) NaN x(4:5)], 1, 2), [NaN 1 NaN 2 NaN]) +***** assert (unifinv ([x, NaN], 1, 2), [NaN 1 1.5 2 NaN NaN]) +***** assert (unifinv (single ([x, NaN]), 1, 2), single ([NaN 1 1.5 2 NaN NaN])) +***** assert (unifinv ([x, NaN], single (1), 2), single ([NaN 1 1.5 2 NaN NaN])) +***** assert (unifinv ([x, NaN], 1, single (2)), single ([NaN 1 1.5 2 NaN NaN])) +***** error unifinv () +***** error unifinv (1,2) +***** error unifinv (1,2,3,4) +***** error unifinv (ones (3), ones (2), ones (2)) +***** error unifinv (ones (2), ones (3), ones (2)) +***** error unifinv (ones (2), ones (2), ones (3)) +***** error unifinv (i, 2, 2) +***** error unifinv (2, i, 2) +***** error unifinv (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped [inst/distributions/expcdf.m] >>>>> /build/octave-statistics-1.4.2/inst/distributions/expcdf.m ***** shared x,y @@ -7077,41 +6085,913 @@ ***** error expcdf (i, 2) ***** error expcdf (2, i) 13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/cauchy_inv.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/cauchy_inv.m +[inst/distributions/poisspdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/poisspdf.m +***** shared x,y + x = [-1 0 1 2 Inf]; + y = [0, exp(-1)*[1 1 0.5], 0]; +***** assert (poisspdf (x, ones (1,5)), y, eps) +***** assert (poisspdf (x, 1), y, eps) +***** assert (poisspdf (x, [1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)], eps) +***** assert (poisspdf ([x, NaN], 1), [y, NaN], eps) +***** assert (poisspdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) +***** assert (poisspdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) +***** error poisspdf () +***** error poisspdf (1) +***** error poisspdf (1,2,3) +***** error poisspdf (ones (3), ones (2)) +***** error poisspdf (ones (2), ones (3)) +***** error poisspdf (i, 2) +***** error poisspdf (2, i) +13 tests, 13 passed, 0 known failure, 0 skipped +[inst/distributions/gaminv.m] +>>>>> /build/octave-statistics-1.4.2/inst/distributions/gaminv.m ***** shared x - x = [-1 0 0.5 1 2]; -***** assert (cauchy_inv (x, ones (1,5), 2*ones (1,5)), [NaN -Inf 1 Inf NaN], eps) -***** assert (cauchy_inv (x, 1, 2*ones (1,5)), [NaN -Inf 1 Inf NaN], eps) -***** assert (cauchy_inv (x, ones (1,5), 2), [NaN -Inf 1 Inf NaN], eps) -***** assert (cauchy_inv (x, [1 -Inf NaN Inf 1], 2), [NaN NaN NaN NaN NaN]) -***** assert (cauchy_inv (x, 1, 2*[1 0 NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (cauchy_inv ([x(1:2) NaN x(4:5)], 1, 2), [NaN -Inf NaN Inf NaN]) -***** assert (cauchy_inv ([x, NaN], 1, 2), [NaN -Inf 1 Inf NaN NaN], eps) -***** assert (cauchy_inv (single ([x, NaN]), 1, 2), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) -***** assert (cauchy_inv ([x, NaN], single (1), 2), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) -***** assert (cauchy_inv ([x, NaN], 1, single (2)), single ([NaN -Inf 1 Inf NaN NaN]), eps ("single")) -***** error cauchy_inv () -***** error cauchy_inv (1,2) -***** error cauchy_inv (1,2,3,4) -***** error cauchy_inv (ones (3), ones (2), ones (2)) -***** error cauchy_inv (ones (2), ones (3), ones (2)) -***** error cauchy_inv (ones (2), ones (2), ones (3)) -***** error cauchy_inv (i, 2, 2) -***** error cauchy_inv (2, i, 2) -***** error cauchy_inv (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_pdf.m] ->>>>> /build/octave-statistics-1.4.2/inst/distributions/laplace_pdf.m + x = [-1 0 0.63212055882855778 1 2]; +***** assert (gaminv (x, ones (1,5), ones (1,5)), [NaN 0 1 Inf NaN], eps) +***** assert (gaminv (x, 1, ones (1,5)), [NaN 0 1 Inf NaN], eps) +***** assert (gaminv (x, ones (1,5), 1), [NaN 0 1 Inf NaN], eps) +***** assert (gaminv (x, [1 -Inf NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) +***** assert (gaminv (x, 1, [1 -Inf NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (gaminv ([x(1:2) NaN x(4:5)], 1, 1), [NaN 0 NaN Inf NaN]) +***** assert (gaminv ([x, NaN], 1, 1), [NaN 0 1 Inf NaN NaN], eps) +***** assert (gaminv (single ([x, NaN]), 1, 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** assert (gaminv ([x, NaN], single (1), 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** assert (gaminv ([x, NaN], 1, single (1)), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** error gaminv () +***** error gaminv (1) +***** error gaminv (1,2) +***** error gaminv (1,2,3,4) +***** error gaminv (ones (3), ones (2), ones (2)) +***** error gaminv (ones (2), ones (3), ones (2)) +***** error gaminv (ones (2), ones (2), ones (3)) +***** error gaminv (i, 2, 2) +***** error gaminv (2, i, 2) +***** error gaminv (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/iwishrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/iwishrnd.m +***** assert(size (iwishrnd (1,2,1)), [1, 1]); +***** assert(size (iwishrnd ([],2,1)), [1, 1]); +***** assert(size (iwishrnd ([3 1; 1 3], 2.00001, [], 1)), [2, 2]); +***** assert(size (iwishrnd (eye(2), 2, [], 3)), [2, 2, 3]); +***** error iwishrnd () +***** error iwishrnd (1) +***** error iwishrnd ([-3 1; 1 3],1) +***** error iwishrnd ([1; 1],1) +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/mahal.m] +>>>>> /build/octave-statistics-1.4.2/inst/mahal.m +***** error mahal () +***** error mahal (1, 2, 3) +***** error mahal ("A", "B") +***** error mahal ([1, 2], ["A", "B"]) +***** error mahal (ones (2, 2, 2)) +***** error mahal (ones (2, 2), ones (2, 2, 2)) +***** error mahal (ones (2, 2), ones (2, 3)) +***** test + X = [1 0; 0 1; 1 1; 0 0]; + assert (mahal (X, X), [1.5; 1.5; 1.5; 1.5], 10*eps) + assert (mahal (X, X+1), [7.5; 7.5; 1.5; 13.5], 10*eps) +***** assert (mahal ([true; true], [false; true]), [0.5; 0.5], eps) +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/mvtrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/mvtrnd.m +***** test + sigma = [1, 0.5; 0.5, 1]; + nu = 3; + n = 10; + x = mvtrnd (sigma, nu, n); + assert (size (x), [10, 2]); +***** test + sigma = [1, 0.5; 0.5, 1]; + nu = [2; 3]; + n = 2; + x = mvtrnd (sigma, nu, 2); + assert (size (x), [2, 2]); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/nanvar.m] +>>>>> /build/octave-statistics-1.4.2/inst/nanvar.m +***** shared x + x = [1 2 nan 3 4 5]; +***** assert (nanvar (x), var (x(! isnan (x))), 10*eps) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/bbscdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/bbscdf.m ***** shared x,y - x = [-Inf -log(2) 0 log(2) Inf]; - y = [0, 1/4, 1/2, 1/4, 0]; -***** assert (laplace_pdf ([x, NaN]), [y, NaN]) -***** assert (laplace_pdf (single ([x, NaN])), single ([y, NaN])) -***** error laplace_pdf () -***** error laplace_pdf (1,2) -***** error laplace_pdf (i) -5 tests, 5 passed, 0 known failure, 0 skipped + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 1/2, 0.76024993890652337, 1]; +***** assert (bbscdf (x, ones (1,5), ones (1,5), zeros (1,5)), y, eps) +***** assert (bbscdf (x, 1, 1, zeros (1,5)), y, eps) +***** assert (bbscdf (x, 1, ones (1,5), 0), y, eps) +***** assert (bbscdf (x, ones (1,5), 1, 0), y, eps) +***** assert (bbscdf (x, 1, 1, 0), y, eps) +***** assert (bbscdf (x, 1, 1, [0, 0, NaN, 0, 0]), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbscdf (x, 1, [1, 1, NaN, 1, 1], 0), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbscdf (x, [1, 1, NaN, 1, 1], 1, 0), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbscdf ([x, NaN], 1, 1, 0), [y, NaN], eps) +***** assert (bbscdf (single ([x, NaN]), 1, 1, 0), single ([y, NaN]), eps('single')) +***** assert (bbscdf ([x, NaN], 1, 1, single (0)), single ([y, NaN]), eps('single')) +***** assert (bbscdf ([x, NaN], 1, single (1), 0), single ([y, NaN]), eps('single')) +***** assert (bbscdf ([x, NaN], single (1), 1, 0), single ([y, NaN]), eps('single')) +***** error bbscdf () +***** error bbscdf (1) +***** error bbscdf (1,2,3) +***** error bbscdf (1,2,3,4,5) +***** error bbscdf (ones (3), ones (2), ones(2), ones(2)) +***** error bbscdf (ones (2), ones (3), ones(2), ones(2)) +***** error bbscdf (ones (2), ones (2), ones(3), ones(2)) +***** error bbscdf (ones (2), ones (2), ones(2), ones(3)) +***** error bbscdf (i, 4, 3, 2) +***** error bbscdf (1, i, 3, 2) +***** error bbscdf (1, 4, i, 2) +***** error bbscdf (1, 4, 3, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/tests/t_test.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/t_test.m +***** xtest + ## Two-sided (also the default option) + x = rand (10,1); n = length (x); + u0 = 0.5; # true mean + xbar = mean (x); + pval = t_test (x, u0, "!="); + if (xbar >= u0) + tval = abs (tinv (0.5*pval, n-1)); + else + tval = -abs (tinv (0.5*pval, n-1)); + endif + unew = tval * std(x)/sqrt(n) + u0; + assert (xbar, unew, 1e6*eps); +***** xtest + x = rand (10,1); n = length (x); + u0 = 0.5; + pval = t_test (x, u0, ">"); + tval = tinv (1-pval, n-1); + unew = tval * std(x)/sqrt(n) + u0; + assert (mean (x), unew, 1e6*eps); +***** xtest + x = rand (10,1); n = length (x); + u0 = 0.5; + pval = t_test (x, u0, "<"); + tval = tinv (pval, n-1); + unew = tval * std(x)/sqrt(n) + u0; + assert (mean (x), unew, 1e6*eps); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/tests/kolmogorov_smirnov_test.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/kolmogorov_smirnov_test.m +***** assert (kolmogorov_smirnov_test (0:100, "unif", 0, 100), 1.0, eps) +***** assert (kolmogorov_smirnov_test (0:100, "logistic"), 0) +***** assert (kolmogorov_smirnov_test (50:100, "unif", 0, 50, "<")) +***** error kolmogorov_smirnov_test (1) +***** error kolmogorov_smirnov_test ({}, "unif", 2, 4) +***** error + kolmogorov_smirnov_test (1, "not_a_dist"); +***** error + kolmogorov_smirnov_test (1, "unif", 2, 4, "foo"); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/tests/z_test.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/z_test.m +***** test + ## Two-sided (also the default option) + x = rand (10,1); n = length (x); + u0 = 0.5; v = 1/12; # true mean, var + pval = z_test (x, u0, v, "!="); + if (mean (x) >= u0) + zval = abs (norminv (0.5*pval)); + else + zval = -abs (norminv (0.5*pval)); + endif + unew = zval * sqrt (v/n) + u0; + assert (mean (x), unew, 100*eps); +***** test + x = rand (10,1); n = length (x); + u0 = 0.5; v = 1/12; + pval = z_test (x, u0, v, ">"); + zval = norminv (1-pval); + unew = zval * sqrt (v/n) + u0; + assert (mean (x), unew, 100*eps); +***** test + x = rand (10,1); n = length (x); + u0 = 0.5; v = 1/12; + pval = z_test (x, u0, v, "<"); + zval = norminv (pval); + unew = zval * sqrt (v/n) + u0; + assert (mean (x), unew, 100*eps); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/tests/kruskal_wallis_test.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/kruskal_wallis_test.m +***** assert (abs (kruskal_wallis_test ([86 86], [74]) - 0.157299207050285) < 0.0000000000001) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/tests/sign_test.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/sign_test.m +***** error sign_test () +***** error sign_test ([]) +***** assert (sign_test (zeros(1,10), ones(1,10)), sign_test (zeros(1,10), ones(1,10), "!=")) +***** assert (sign_test (zeros(1,10), ones(1,10)), sign_test (zeros(1,10), ones(1,10), "<>")) +***** assert (sign_test (ones(1,10), zeros(1,10), '<'), 0) +***** assert (sign_test (ones(1,10), zeros(1,10), '>'), 1) +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/tests/z_test_2.m] +>>>>> /build/octave-statistics-1.4.2/inst/tests/z_test_2.m +***** test + ## Two-sided (also the default option) + x = randn (100, 1); v_x = 2; x = v_x * x; + [pval, zval] = z_test_2 (x, x, v_x, v_x); + zval_exp = 0; pval_exp = 1.0; + assert (zval, zval_exp, eps); + assert (pval, pval_exp, eps); +***** test + ## Two-sided (also the default option) + x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); + y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); + [pval, z] = z_test_2 (x, y, v_x, v_y); + if (mean (x) >= mean (y)) + zval = abs (norminv (0.5*pval)); + else + zval = -abs (norminv (0.5*pval)); + endif + unew = zval * sqrt (v_x/n_x + v_y/n_y); + delmu = mean (x) - mean (y); + assert (delmu, unew, 100*eps); +***** test + x = randn (100, 1); v_x = 2; x = v_x * x; + [pval, zval] = z_test_2 (x, x, v_x, v_x, ">"); + zval_exp = 0; pval_exp = 0.5; + assert (zval, zval_exp, eps); + assert (pval, pval_exp, eps); +***** test + x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); + y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); + [pval, z] = z_test_2 (x, y, v_x, v_y, ">"); + zval = norminv (1-pval); + unew = zval * sqrt (v_x/n_x + v_y/n_y); + delmu = mean (x) - mean (y); + assert (delmu, unew, 100*eps); +***** test + x = randn (100, 1); v_x = 2; x = v_x * x; + [pval, zval] = z_test_2 (x, x, v_x, v_x, "<"); + zval_exp = 0; pval_exp = 0.5; + assert (zval, zval_exp, eps); + assert (pval, pval_exp, eps); +***** test + x = randn (10000, 1); v_x = 2; x = v_x * x; n_x = length (x); + y = randn (20000, 1); v_y = 3; y = v_y * y; n_y = length (y); + [pval, z] = z_test_2 (x, y, v_x, v_y, "<"); + zval = norminv (pval); + unew = zval * sqrt (v_x/n_x + v_y/n_y); + delmu = mean (x) - mean (y); + assert (delmu, unew, 100*eps); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/gamfit.m] +>>>>> /build/octave-statistics-1.4.2/inst/gamfit.m +***** shared v, res + v = [1.2 1.6 1.7 1.8 1.9 2.0 2.2 2.6 3.0 3.5 4.0 4.8 5.6 6.6 7.6]; + res = gamfit(v); +***** assert (res(1), 3.425, 1E-3); +***** assert (res(2), 0.975, 1E-3); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/hist3.m] +>>>>> /build/octave-statistics-1.4.2/inst/hist3.m +***** demo + X = [ + 1 1 + 1 1 + 1 10 + 1 10 + 5 5 + 5 5 + 5 5 + 5 5 + 5 5 + 7 3 + 7 3 + 7 3 + 10 10 + 10 10]; + hist3 (X) +***** test + N_exp = [ 0 0 0 5 20 + 0 0 10 15 0 + 0 15 10 0 0 + 20 5 0 0 0]; + + n = 100; + x = [1:n]'; + y = [n:-1:1]'; + D = [x y]; + N = hist3 (D, [4 5]); + assert (N, N_exp); +***** test + N_exp = [0 0 0 0 1 + 0 0 0 0 1 + 0 0 0 0 1 + 1 1 1 1 93]; + + n = 100; + x = [1:n]'; + y = [n:-1:1]'; + D = [x y]; + C{1} = [1 1.7 3 4]; + C{2} = [1:5]; + N = hist3 (D, C); + assert (N, N_exp); +***** test + D = [1 1; 3 1; 3 3; 3 1]; + [c, nn] = hist3 (D, {0:4, 0:4}); + exp_c = zeros (5); + exp_c([7 9 19]) = [1 2 1]; + assert (c, exp_c); + assert (nn, {0:4, 0:4}); +***** test + for i = 10 + assert (size (hist3 (rand (9, 2), "Edges", {[0:.2:1]; [0:.2:1]})), [6 6]) + endfor +***** test + edge_1 = linspace (0, 10, 10); + edge_2 = linspace (0, 50, 10); + [c, nn] = hist3 ([1:10; 1:5:50]', "Edges", {edge_1, edge_2}); + exp_c = zeros (10, 10); + exp_c([1 12 13 24 35 46 57 68 79 90]) = 1; + assert (c, exp_c); + + assert (nn{1}, edge_1 + edge_1(2)/2, eps*10^4) + assert (nn{2}, edge_2 + edge_2(2)/2, eps*10^4) +***** shared X + X = [ + 5 2 + 5 3 + 1 4 + 5 3 + 4 4 + 1 2 + 2 3 + 3 3 + 5 4 + 5 3]; +***** test + N = zeros (10); + N([1 10 53 56 60 91 98 100]) = [1 1 1 1 3 1 1 1]; + C = {(1.2:0.4:4.8), (2.1:0.2:3.9)}; + assert (nthargout ([1 2], @hist3, X), {N C}, eps*10^3) +***** test + N = zeros (5, 7); + N([1 5 17 18 20 31 34 35]) = [1 1 1 1 3 1 1 1]; + C = {(1.4:0.8:4.6), ((2+(1/7)):(2/7):(4-(1/7)))}; + assert (nthargout ([1 2], @hist3, X, [5 7]), {N C}, eps*10^3) + assert (nthargout ([1 2], @hist3, X, "Nbins", [5 7]), {N C}, eps*10^3) +***** test + N = [0 1 0; 0 1 0; 0 0 1; 0 0 0]; + C = {(2:5), (2.5:1:4.5)}; + assert (nthargout ([1 2], @hist3, X, "Edges", {(1.5:4.5), (2:4)}), {N C}) +***** test + N = [0 0 1 0 1 0; 0 0 0 1 0 0; 0 0 1 4 2 0]; + C = {(1.2:3.2), (0:5)}; + assert (nthargout ([1 2], @hist3, X, "Ctrs", C), {N C}) + assert (nthargout ([1 2], @hist3, X, C), {N C}) +***** test + [~, C] = hist3 (rand (10, 2), "Edges", {[0 .05 .15 .35 .55 .95], + [-1 .05 .07 .2 .3 .5 .89 1.2]}); + C_exp = {[ 0.025 0.1 0.25 0.45 0.75 1.15], ... + [-0.475 0.06 0.135 0.25 0.4 0.695 1.045 1.355]}; + assert (C, C_exp, eps*10^2) +***** test + Xv = repmat ([1:10]', [1 2]); + + ## Test Centers + assert (hist3 (Xv, "Ctrs", {1:10, 1:10}), eye (10)) + + N_exp = eye (6); + N_exp([1 end]) = 3; + assert (hist3 (Xv, "Ctrs", {3:8, 3:8}), N_exp) + + N_exp = zeros (8, 6); + N_exp([1 2 11 20 29 38 47 48]) = [2 1 1 1 1 1 1 2]; + assert (hist3 (Xv, "Ctrs", {2:9, 3:8}), N_exp) + + ## Test Edges + assert (hist3 (Xv, "Edges", {1:10, 1:10}), eye (10)) + assert (hist3 (Xv, "Edges", {3:8, 3:8}), eye (6)) + assert (hist3 (Xv, "Edges", {2:9, 3:8}), [zeros(1, 6); eye(6); zeros(1, 6)]) + + N_exp = zeros (14); + N_exp(3:12, 3:12) = eye (10); + assert (hist3 (Xv, "Edges", {-1:12, -1:12}), N_exp) + + ## Test for Nbins + assert (hist3 (Xv), eye (10)) + assert (hist3 (Xv, [10 10]), eye (10)) + assert (hist3 (Xv, "nbins", [10 10]), eye (10)) + assert (hist3 (Xv, [5 5]), eye (5) * 2) + + N_exp = zeros (7, 5); + N_exp([1 9 10 18 26 27 35]) = [2 1 1 2 1 1 2]; + assert (hist3 (Xv, [7 5]), N_exp) +***** test # bug #51059 + D = [1 1; NaN 2; 3 1; 3 3; 1 NaN; 3 1]; + [c, nn] = hist3 (D, {0:4, 0:4}); + exp_c = zeros (5); + exp_c([7 9 19]) = [1 2 1]; + assert (c, exp_c) + assert (nn, {0:4, 0:4}) +***** test + [c, nn] = hist3 ([1 8]); + exp_c = zeros (10, 10); + exp_c(6, 6) = 1; + exp_nn = {-4:5, 3:12}; + assert (c, exp_c) + assert (nn, exp_nn, eps) + + [c, nn] = hist3 ([1 8], [10 11]); + exp_c = zeros (10, 11); + exp_c(6, 6) = 1; + exp_nn = {-4:5, 3:13}; + assert (c, exp_c) + assert (nn, exp_nn, eps) +***** test + [c, nn] = hist3 ([1 NaN; 2 3; 6 9; 8 NaN]); + exp_c = zeros (10, 10); + exp_c(2, 1) = 1; + exp_c(8, 10) = 1; + exp_nn = {linspace(1.35, 7.65, 10) linspace(3.3, 8.7, 10)}; + assert (c, exp_c) + assert (nn, exp_nn, eps*100) +***** test + [c, nn] = hist3 ([1 NaN; 2 NaN; 6 NaN; 8 NaN]); + exp_c = zeros (10, 10); + exp_nn = {linspace(1.35, 7.65, 10) NaN(1, 10)}; + assert (c, exp_c) + assert (nn, exp_nn, eps*100) +***** test + [c, nn] = hist3 ([1 NaN; NaN 3; NaN 9; 8 NaN]); + exp_c = zeros (10, 10); + exp_nn = {linspace(1.35, 7.65, 10) linspace(3.3, 8.7, 10)}; + assert (c, exp_c) + assert (nn, exp_nn, eps*100) +16 tests, 16 passed, 0 known failure, 0 skipped +[inst/raylrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/raylrnd.m +***** test + sigma = 1:6; + x = raylrnd (sigma); + assert (size (x), size (sigma)); + assert (all (x >= 0)); +***** test + sigma = 0.5; + sz = [2, 3]; + x = raylrnd (sigma, sz); + assert (size (x), sz); + assert (all (x >= 0)); +***** test + sigma = 0.5; + r = 2; + c = 3; + x = raylrnd (sigma, r, c); + assert (size (x), [r, c]); + assert (all (x >= 0)); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/nakainv.m] +>>>>> /build/octave-statistics-1.4.2/inst/nakainv.m +***** shared x,y + x = [-Inf, -1, 0, 1/2, 1, 2, Inf]; + y = [NaN, NaN, 0, 0.83255461115769769, Inf, NaN, NaN]; +***** assert (nakainv (x, ones (1,7), ones (1,7)), y, eps) +***** assert (nakainv (x, 1, 1), y, eps) +***** assert (nakainv (x, [1, 1, 1, NaN, 1, 1, 1], 1), [y(1:3), NaN, y(5:7)], eps) +***** assert (nakainv (x, 1, [1, 1, 1, NaN, 1, 1, 1]), [y(1:3), NaN, y(5:7)], eps) +***** assert (nakainv ([x, NaN], 1, 1), [y, NaN], eps) +***** assert (nakainv (single ([x, NaN]), 1, 1), single ([y, NaN])) +***** assert (nakainv ([x, NaN], single (1), 1), single ([y, NaN])) +***** assert (nakainv ([x, NaN], 1, single (1)), single ([y, NaN])) +***** error nakainv () +***** error nakainv (1) +***** error nakainv (1,2) +***** error nakainv (1,2,3,4) +***** error nakainv (ones (3), ones (2), ones(2)) +***** error nakainv (ones (2), ones (3), ones(2)) +***** error nakainv (ones (2), ones (2), ones(3)) +***** error nakainv (i, 2, 2) +***** error nakainv (2, i, 2) +***** error nakainv (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/regress.m] +>>>>> /build/octave-statistics-1.4.2/inst/regress.m +***** test + % Longley data from the NIST Statistical Reference Dataset + Z = [ 60323 83.0 234289 2356 1590 107608 1947 + 61122 88.5 259426 2325 1456 108632 1948 + 60171 88.2 258054 3682 1616 109773 1949 + 61187 89.5 284599 3351 1650 110929 1950 + 63221 96.2 328975 2099 3099 112075 1951 + 63639 98.1 346999 1932 3594 113270 1952 + 64989 99.0 365385 1870 3547 115094 1953 + 63761 100.0 363112 3578 3350 116219 1954 + 66019 101.2 397469 2904 3048 117388 1955 + 67857 104.6 419180 2822 2857 118734 1956 + 68169 108.4 442769 2936 2798 120445 1957 + 66513 110.8 444546 4681 2637 121950 1958 + 68655 112.6 482704 3813 2552 123366 1959 + 69564 114.2 502601 3931 2514 125368 1960 + 69331 115.7 518173 4806 2572 127852 1961 + 70551 116.9 554894 4007 2827 130081 1962 ]; + % Results certified by NIST using 500 digit arithmetic + % b and standard error in b + V = [ -3482258.63459582 890420.383607373 + 15.0618722713733 84.9149257747669 + -0.358191792925910E-01 0.334910077722432E-01 + -2.02022980381683 0.488399681651699 + -1.03322686717359 0.214274163161675 + -0.511041056535807E-01 0.226073200069370 + 1829.15146461355 455.478499142212 ]; + Rsq = 0.995479004577296; + F = 330.285339234588; + y = Z(:,1); X = [ones(rows(Z),1), Z(:,2:end)]; + alpha = 0.05; + [b, bint, r, rint, stats] = regress (y, X, alpha); + assert(b,V(:,1),3e-6); + assert(stats(1),Rsq,1e-12); + assert(stats(2),F,3e-8); + assert(((bint(:,1)-bint(:,2))/2)/tinv(alpha/2,9),V(:,2),-1.e-5); +warning: matrix singular to machine precision, rcond = 3.50566e-20 +warning: called from + regress at line 134 column 7 + __test__ at line 33 column 28 + test at line 677 column 11 + /tmp/tmp.J1MIIy9ZIU at line 1366 column 31 + +1 test, 1 passed, 0 known failure, 0 skipped +[inst/hmmestimate.m] +>>>>> /build/octave-statistics-1.4.2/inst/hmmestimate.m +***** test + sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; + states = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; + [transprobest, outprobest] = hmmestimate (sequence, states); + expectedtransprob = [0.88889, 0.11111; 0.28571, 0.71429]; + expectedoutprob = [0.16667, 0.33333, 0.50000; 1.00000, 0.00000, 0.00000]; + assert (transprobest, expectedtransprob, 0.001); + assert (outprobest, expectedoutprob, 0.001); +***** test + sequence = {'A', 'B', 'A', 'A', 'A', 'B', 'B', 'A', 'B', 'C', 'C', 'C', 'C', 'B', 'C', 'A', 'A', 'A', 'A', 'C', 'C', 'B', 'C', 'A', 'C'}; + states = {'One', 'One', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'Two', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One'}; + symbols = {'A', 'B', 'C'}; + statenames = {'One', 'Two'}; + [transprobest, outprobest] = hmmestimate (sequence, states, 'symbols', symbols, 'statenames', statenames); + expectedtransprob = [0.88889, 0.11111; 0.28571, 0.71429]; + expectedoutprob = [0.16667, 0.33333, 0.50000; 1.00000, 0.00000, 0.00000]; + assert (transprobest, expectedtransprob, 0.001); + assert (outprobest, expectedoutprob, 0.001); +***** test + sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; + states = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; + pseudotransitions = [8, 2; 4, 6]; + pseudoemissions = [2, 4, 4; 7, 2, 1]; + [transprobest, outprobest] = hmmestimate (sequence, states, 'pseudotransitions', pseudotransitions, 'pseudoemissions', pseudoemissions); + expectedtransprob = [0.85714, 0.14286; 0.35294, 0.64706]; + expectedoutprob = [0.178571, 0.357143, 0.464286; 0.823529, 0.117647, 0.058824]; + assert (transprobest, expectedtransprob, 0.001); + assert (outprobest, expectedoutprob, 0.001); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/randsample.m] +>>>>> /build/octave-statistics-1.4.2/inst/randsample.m +***** test + n = 20; + k = 5; + x = randsample(n, k); + assert (size(x), [1 k]); + x = randsample(n, k, true); + assert (size(x), [1 k]); + x = randsample(n, k, false); + assert (size(x), [1 k]); + x = randsample(n, k, true, ones(n, 1)); + assert (size(x), [1 k]); + x = randsample(1:n, k); + assert (size(x), [1 k]); + x = randsample(1:n, k, true); + assert (size(x), [1 k]); + x = randsample(1:n, k, false); + assert (size(x), [1 k]); + x = randsample(1:n, k, true, ones(n, 1)); + assert (size(x), [1 k]); + x = randsample((1:n)', k); + assert (size(x), [k 1]); + x = randsample((1:n)', k, true); + assert (size(x), [k 1]); + x = randsample((1:n)', k, false); + assert (size(x), [k 1]); + x = randsample((1:n)', k, true, ones(n, 1)); + assert (size(x), [k 1]); + n = 10; + k = 100; + x = randsample(n, k, true, 1:n); + assert (size(x), [1 k]); + x = randsample((1:n)', k, true); + assert (size(x), [k 1]); + x = randsample(k, k, false, 1:k); + assert (size(x), [1 k]); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/gevfit_lmom.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevfit_lmom.m +***** xtest <31070> + data = 1:50; + [pfit, pci] = gevfit_lmom (data); + expected_p = [-0.28 15.01 20.22]'; + assert (pfit, expected_p, 0.1); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/gevinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/gevinv.m +***** test + p = 0.1:0.1:0.9; + k = 0; + sigma = 1; + mu = 0; + x = gevinv (p, k, sigma, mu); + c = gevcdf(x, k, sigma, mu); + assert (c, p, 0.001); +***** test + p = 0.1:0.1:0.9; + k = 1; + sigma = 1; + mu = 0; + x = gevinv (p, k, sigma, mu); + c = gevcdf(x, k, sigma, mu); + assert (c, p, 0.001); +***** test + p = 0.1:0.1:0.9; + k = 0.3; + sigma = 1; + mu = 0; + x = gevinv (p, k, sigma, mu); + c = gevcdf(x, k, sigma, mu); + assert (c, p, 0.001); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/tblread.m] +>>>>> /build/octave-statistics-1.4.2/inst/tblread.m +***** shared d, v, c, tblreadspacefile, tblreadtabfile + d = [1 2;3 4]; + v = ["a ";"bc"]; + c = ["de";"f "]; + tblreadspacefile = file_in_loadpath("test/tblread-space.dat"); + tblreadtabfile = file_in_loadpath("test/tblread-tab.dat"); +***** test + [dt vt ct] = tblread (tblreadspacefile); + assert (dt, d); + assert (vt, v); + assert (ct, c); +***** test + [dt vt ct] = tblread (tblreadspacefile, " "); + assert (dt, d); + assert (vt, v); + assert (ct, c); +***** test + [dt vt ct] = tblread (tblreadspacefile, "space"); + assert (dt, d); + assert (vt, v); + assert (ct, c); +***** test + [dt vt ct] = tblread (tblreadtabfile, "tab"); + assert (dt, d); + assert (vt, v); + assert (ct, c); +***** test + [dt vt ct] = tblread (tblreadtabfile, "\t"); + assert (dt, d); + assert (vt, v); + assert (ct, c); +***** test + [dt vt ct] = tblread (tblreadtabfile, '\t'); + assert (dt, d); + assert (vt, v); + assert (ct, c); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/normstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/normstat.m +***** test + m = 1:6; + s = 0.2:0.2:1.2; + [mn, v] = normstat (m, s); + expected_v = [0.0400, 0.1600, 0.3600, 0.6400, 1.0000, 1.4400]; + assert (mn, m); + assert (v, expected_v, 0.001); +***** test + s = 0.2:0.2:1.2; + [mn, v] = normstat (0, s); + expected_mn = [0, 0, 0, 0, 0, 0]; + expected_v = [0.0400, 0.1600, 0.3600, 0.6400, 1.0000, 1.4400]; + assert (mn, expected_mn, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/gpcdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/gpcdf.m +***** shared x,y1,y2,y3 + x = [-Inf, -1, 0, 1/2, 1, Inf]; + y1 = [0, 0, 0, 0.3934693402873666, 0.6321205588285577, 1]; + y2 = [0, 0, 0, 1/3, 1/2, 1]; + y3 = [0, 0, 0, 1/2, 1, 1]; + seps = eps('single')*5; +***** assert (gpcdf (x, zeros (1,6), ones (1,6), zeros (1,6)), y1, eps) +***** assert (gpcdf (x, 0, 1, zeros (1,6)), y1, eps) +***** assert (gpcdf (x, 0, ones (1,6), 0), y1, eps) +***** assert (gpcdf (x, zeros (1,6), 1, 0), y1, eps) +***** assert (gpcdf (x, 0, 1, 0), y1, eps) +***** assert (gpcdf (x, 0, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y1(5:6)], eps) +***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y1(5:6)], eps) +***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 0), [y1(1:3), NaN, y1(5:6)], eps) +***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, 0), [y1(1:3), NaN, y1(5:6)], eps) +***** assert (gpcdf (x, ones (1,6), ones (1,6), zeros (1,6)), y2, eps) +***** assert (gpcdf (x, 1, 1, zeros (1,6)), y2, eps) +***** assert (gpcdf (x, 1, ones (1,6), 0), y2, eps) +***** assert (gpcdf (x, ones (1,6), 1, 0), y2, eps) +***** assert (gpcdf (x, 1, 1, 0), y2, eps) +***** assert (gpcdf (x, 1, 1, [0, 0, 0, NaN, 0, 0]), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, 1, [1, 1, 1, NaN, 1, 1], 0), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, [1, 1, 1, NaN, 1, 1], 1, 0), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 1, 1, 0), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, -ones (1,6), ones (1,6), zeros (1,6)), y3, eps) +***** assert (gpcdf (x, -1, 1, zeros (1,6)), y3, eps) +***** assert (gpcdf (x, -1, ones (1,6), 0), y3, eps) +***** assert (gpcdf (x, -ones (1,6), 1, 0), y3, eps) +***** assert (gpcdf (x, -1, 1, 0), y3, eps) +***** assert (gpcdf (x, -1, 1, [0, 0, 0, NaN, 0, 0]), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf (x, -1, [1, 1, 1, NaN, 1, 1], 0), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf (x, [-1, -1, -1, NaN, -1, -1], 1, 0), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf ([x(1:3), NaN, x(5:6)], -1, 1, 0), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, single (1), 0), single ([y1, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], single (0), 1, 0), single ([y1, NaN]), eps('single')) +***** assert (gpcdf (single ([x, NaN]), 1, 1, 0), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 1, 1, single (0)), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 1, single (1), 0), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], single (1), 1, 0), single ([y2, NaN]), eps('single')) +***** assert (gpcdf (single ([x, NaN]), -1, 1, 0), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], -1, 1, single (0)), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], -1, single (1), 0), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], single (-1), 1, 0), single ([y3, NaN]), eps('single')) +***** error gpcdf () +***** error gpcdf (1) +***** error gpcdf (1,2) +***** error gpcdf (1,2,3) +***** error gpcdf (1,2,3,4,5) +***** error gpcdf (ones (3), ones (2), ones (2), ones (2)) +***** error gpcdf (ones (2), ones (2), ones (2), ones (3)) +***** error gpcdf (ones (2), ones (2), ones (3), ones (2)) +***** error gpcdf (ones (2), ones (3), ones (2), ones (2)) +***** error gpcdf (i, 2, 2, 2) +***** error gpcdf (2, i, 2, 2) +***** error gpcdf (2, 2, i, 2) +***** error gpcdf (2, 2, 2, i) +52 tests, 52 passed, 0 known failure, 0 skipped +[inst/copulapdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/copulapdf.m +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + theta = [1; 2]; + p = copulapdf ("Clayton", x, theta); + expected_p = [0.9872; 0.7295]; + assert (p, expected_p, 0.001); +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + p = copulapdf ("Gumbel", x, 2); + expected_p = [0.9468; 0.9468]; + assert (p, expected_p, 0.001); +***** test + x = [0.2, 0.6; 0.2, 0.6]; + theta = [1; 2]; + p = copulapdf ("Frank", x, theta); + expected_p = [0.9378; 0.8678]; + assert (p, expected_p, 0.001); +***** test + x = [0.2, 0.6; 0.2, 0.6]; + theta = [0.3; 0.7]; + p = copulapdf ("AMH", x, theta); + expected_p = [0.9540; 0.8577]; + assert (p, expected_p, 0.001); +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/trirnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/trirnd.m +***** assert (size (trirnd (1,2,1.5)), [1, 1]) +***** assert (size (trirnd (1*ones (2,1), 2,1.5)), [2, 1]) +***** assert (size (trirnd (1*ones (2,2), 2,1.5)), [2, 2]) +***** assert (size (trirnd (1, 2*ones (2,1), 1.5)), [2, 1]) +***** assert (size (trirnd (1, 2*ones (2,2), 1.5)), [2, 2]) +***** assert (size (trirnd (1, 2, 1.5*ones (2,1))), [2, 1]) +***** assert (size (trirnd (1, 2, 1.5*ones (2,2))), [2, 2]) +***** assert (size (trirnd (1, 2, 1.5, 3)), [3, 3]) +***** assert (size (trirnd (1, 2, 1.5, [4 1])), [4, 1]) +***** assert (size (trirnd (1, 2, 1.5, 4, 1)), [4, 1]) +***** assert (class (trirnd (1,2,1.5)), "double") +***** assert (class (trirnd (single (1),2,1.5)), "single") +***** assert (class (trirnd (single ([1 1]),2,1.5)), "single") +***** assert (class (trirnd (1,single (2),1.5)), "single") +***** assert (class (trirnd (1,single ([2 2]),1.5)), "single") +***** assert (class (trirnd (1,2,single (1.5))), "single") +***** assert (class (trirnd (1,2,single ([1.5 1.5]))), "single") +***** error trirnd () +***** error trirnd (1) +***** error trirnd (1,2) +***** error trirnd (ones (3), 2*ones (2), 1.5*ones (2), 2) +***** error trirnd (ones (2), 2*ones (3), 1.5*ones (2), 2) +***** error trirnd (ones (2), 2*ones (2), 1.5*ones (3), 2) +***** error trirnd (i, 2, 1.5) +***** error trirnd (1, i, 1.5) +***** error trirnd (1, 2, i) +***** error trirnd (1,2,1.5, -1) +***** error trirnd (1,2,1.5, ones (2)) +***** error trirnd (1,2,1.5, [2 -1 2]) +***** error trirnd (1*ones (2),2,1.5, 3) +***** error trirnd (1*ones (2),2,1.5, [3, 2]) +***** error trirnd (1*ones (2),2,1.5, 3, 2) +32 tests, 32 passed, 0 known failure, 0 skipped +[inst/raylstat.m] +>>>>> /build/octave-statistics-1.4.2/inst/raylstat.m +***** test + sigma = 1:6; + [m, v] = raylstat (sigma); + expected_m = [1.2533, 2.5066, 3.7599, 5.0133, 6.2666, 7.5199]; + expected_v = [0.4292, 1.7168, 3.8628, 6.8673, 10.7301, 15.4513]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/burrinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/burrinv.m +***** shared x,y + x = [-Inf, -1, 0, 1/2, 1, 2, Inf]; + y = [NaN, NaN, 0, 1 , Inf, NaN, NaN]; +***** assert (burrinv (x, ones (1,7), ones (1,7), ones(1,7)), y, eps) +***** assert (burrinv (x, 1, 1, 1), y, eps) +***** assert (burrinv (x, [1, 1, 1, NaN, 1, 1, 1], 1, 1), [y(1:3), NaN, y(5:7)], eps) +***** assert (burrinv (x, 1, [1, 1, 1, NaN, 1, 1, 1], 1), [y(1:3), NaN, y(5:7)], eps) +***** assert (burrinv (x, 1, 1, [1, 1, 1, NaN, 1, 1, 1]), [y(1:3), NaN, y(5:7)], eps) +***** assert (burrinv ([x, NaN], 1, 1, 1), [y, NaN], eps) +***** assert (burrinv (single ([x, NaN]), 1, 1, 1), single ([y, NaN]), eps('single')) +***** assert (burrinv ([x, NaN], single (1), 1, 1), single ([y, NaN]), eps('single')) +***** assert (burrinv ([x, NaN], 1, single (1), 1), single ([y, NaN]), eps('single')) +***** assert (burrinv ([x, NaN], 1, 1, single (1)), single ([y, NaN]), eps('single')) +***** error burrinv () +***** error burrinv (1) +***** error burrinv (1,2) +***** error burrinv (1,2,3) +***** error burrinv (1,2,3,4,5) +***** error burrinv (ones (3), ones (2), ones(2), ones(2)) +***** error burrinv (ones (2), ones (3), ones(2), ones(2)) +***** error burrinv (ones (2), ones (2), ones(3), ones(2)) +***** error burrinv (ones (2), ones (2), ones(2), ones(3)) +***** error burrinv (i, 2, 2, 2) +***** error burrinv (2, i, 2, 2) +***** error burrinv (2, 2, i, 2) +***** error burrinv (2, 2, 2, i) +23 tests, 23 passed, 0 known failure, 0 skipped +[inst/princomp.m] +>>>>> /build/octave-statistics-1.4.2/inst/princomp.m +***** shared COEFF,SCORE,latent,tsquare,m,x,R,V,lambda,i,S,F +***** test + x=[7 4 3 + 4 1 8 + 6 3 5 + 8 6 1 + 8 5 7 + 7 2 9 + 5 3 3 + 9 5 8 + 7 4 5 + 8 2 2]; + R = corrcoef (x); + [V, lambda] = eig (R); + [~, i] = sort(diag(lambda), "descend"); #arrange largest PC first + S = V(:, i) * diag(sqrt(diag(lambda)(i))); +***** assert(diag(S(:, 1:2)*S(:, 1:2)'), [0.8662; 0.8420; 0.9876], 1E-4); #contribution of first 2 PCs to each original variable + B = V(:, i) * diag( 1./ sqrt(diag(lambda)(i))); + F = zscore(x)*B; + [COEFF,SCORE,latent,tsquare] = princomp(zscore(x, 1)); +***** assert(tsquare,sumsq(F, 2),1E4*eps); +***** test + x=[1,2,3;2,1,3]'; + [COEFF,SCORE,latent,tsquare] = princomp(x); + m=[sqrt(2),sqrt(2);sqrt(2),-sqrt(2);-2*sqrt(2),0]/2; + m(:,1) = m(:,1)*sign(COEFF(1,1)); + m(:,2) = m(:,2)*sign(COEFF(1,2)); +***** assert(COEFF,m(1:2,:),10*eps); +***** assert(SCORE,-m,10*eps); +***** assert(latent,[1.5;.5],10*eps); +***** assert(tsquare,[4;4;4]/3,10*eps); +***** test + x=x'; + [COEFF,SCORE,latent,tsquare] = princomp(x); + m=[sqrt(2),sqrt(2),0;-sqrt(2),sqrt(2),0;0,0,2]/2; + m(:,1) = m(:,1)*sign(COEFF(1,1)); + m(:,2) = m(:,2)*sign(COEFF(1,2)); + m(:,3) = m(:,3)*sign(COEFF(3,3)); +***** assert(COEFF,m,10*eps); +***** assert(SCORE(:,1),-m(1:2,1),10*eps); +***** assert(SCORE(:,2:3),zeros(2),10*eps); +***** assert(latent,[1;0;0],10*eps); +***** assert(tsquare,[0.5;0.5],10*eps) +***** test + [COEFF,SCORE,latent,tsquare] = princomp(x, "econ"); +***** assert(COEFF,m(:, 1),10*eps); +***** assert(SCORE,-m(1:2,1),10*eps); +***** assert(latent,[1],10*eps); +***** assert(tsquare,[0.5;0.5],10*eps) +19 tests, 19 passed, 0 known failure, 0 skipped [inst/tblwrite.m] >>>>> /build/octave-statistics-1.4.2/inst/tblwrite.m ***** shared privpath @@ -7229,25 +7109,180 @@ assert (ct, c); delete (tempfilename); 17 tests, 17 passed, 0 known failure, 0 skipped -[inst/hmmviterbi.m] ->>>>> /build/octave-statistics-1.4.2/inst/hmmviterbi.m +[inst/bbsrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/bbsrnd.m +***** assert (size (bbsrnd (1, 1, 0)), [1 1]) +***** assert (size (bbsrnd (1, 1, zeros (2,1))), [2, 1]) +***** assert (size (bbsrnd (1, 1, zeros (2,2))), [2, 2]) +***** assert (size (bbsrnd (1, ones (2,1), 0)), [2, 1]) +***** assert (size (bbsrnd (1, ones (2,2), 0)), [2, 2]) +***** assert (size (bbsrnd (ones (2,1), 1, 0)), [2, 1]) +***** assert (size (bbsrnd (ones (2,2), 1, 0)), [2, 2]) +***** assert (size (bbsrnd (1, 1, 0, 3)), [3, 3]) +***** assert (size (bbsrnd (1, 1, 0, [4 1])), [4, 1]) +***** assert (size (bbsrnd (1, 1, 0, 4, 1)), [4, 1]) +***** assert (class (bbsrnd (1,1,0)), "double") +***** assert (class (bbsrnd (1, 1, single (0))), "single") +***** assert (class (bbsrnd (1, 1, single ([0 0]))), "single") +***** assert (class (bbsrnd (1, single (1), 0)), "single") +***** assert (class (bbsrnd (1, single ([1 1]), 0)), "single") +***** assert (class (bbsrnd (single (1), 1, 0)), "single") +***** assert (class (bbsrnd (single ([1 1]), 1, 0)), "single") +***** error bbsrnd () +***** error bbsrnd (1) +***** error bbsrnd (1,2) +***** error bbsrnd (ones (3), ones (2), ones (2), 2) +***** error bbsrnd (ones (2), ones (3), ones (2), 2) +***** error bbsrnd (ones (2), ones (2), ones (3), 2) +***** error bbsrnd (i, 2, 3) +***** error bbsrnd (1, i, 3) +***** error bbsrnd (1, 2, i) +***** error bbsrnd (1,2,3, -1) +***** error bbsrnd (1,2,3, ones (2)) +***** error bbsrnd (1,2,3, [2 -1 2]) +***** error bbsrnd (2, 1, ones (2), 3) +***** error bbsrnd (2, 1, ones (2), [3, 2]) +***** error bbsrnd (2, 1, ones (2), 3, 2) +32 tests, 32 passed, 0 known failure, 0 skipped +[inst/mvtpdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/mvtpdf.m +***** assert (mvtpdf ([0 0], eye(2), 1), 0.1591549, 1E-7) #dmvt(x = c(0,0), sigma = diag(2), log = FALSE) +***** assert (mvtpdf ([1 0], [1 0.5; 0.5 1], 2), 0.06615947, 1E-7) #dmvt(x = c(1,0), sigma = matrix(c(1, 0.5, 0.5, 1), nrow=2, ncol=2), df = 2, log = FALSE) +***** assert (mvtpdf ([1 0.4 0; 1.2 0.5 0.5; 1.4 0.6 1], [1 0.5 0.3; 0.5 1 0.6; 0.3 0.6 1], [5 6 7]), [0.04713313 0.03722421 0.02069011]', 1E-7) #dmvt(x = c(1,0.4,0), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 5, log = FALSE); dmvt(x = c(1.2,0.5,0.5), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 6, log = FALSE); dmvt(x = c(1.4,0.6,1), sigma = matrix(c(1, 0.5, 0.3, 0.5, 1, 0.6, 0.3, 0.6, 1), nrow=3, ncol=3), df = 7, log = FALSE) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/bbspdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/bbspdf.m +***** shared x,y + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 0.3989422804014327, 0.1647717335503959, 0]; +***** assert (bbspdf (x, ones (1,5), ones (1,5), zeros (1,5)), y, eps) +***** assert (bbspdf (x, 1, 1, zeros (1,5)), y, eps) +***** assert (bbspdf (x, 1, ones (1,5), 0), y, eps) +***** assert (bbspdf (x, ones (1,5), 1, 0), y, eps) +***** assert (bbspdf (x, 1, 1, 0), y, eps) +***** assert (bbspdf (x, 1, 1, [0, 0, NaN, 0, 0]), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf (x, 1, [1, 1, NaN, 1, 1], 0), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf (x, [1, 1, NaN, 1, 1], 1, 0), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf ([x, NaN], 1, 1, 0), [y, NaN], eps) +***** assert (bbspdf (single ([x, NaN]), 1, 1, 0), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], 1, 1, single (0)), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], 1, single (1), 0), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], single (1), 1, 0), single ([y, NaN]), eps('single')) +***** error bbspdf () +***** error bbspdf (1) +***** error bbspdf (1,2,3) +***** error bbspdf (1,2,3,4,5) +***** error bbspdf (ones (3), ones (2), ones(2), ones(2)) +***** error bbspdf (ones (2), ones (3), ones(2), ones(2)) +***** error bbspdf (ones (2), ones (2), ones(3), ones(2)) +***** error bbspdf (ones (2), ones (2), ones(2), ones(3)) +***** error bbspdf (i, 4, 3, 2) +***** error bbspdf (1, i, 3, 2) +***** error bbspdf (1, 4, i, 2) +***** error bbspdf (1, 4, 3, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/mvnrnd.m] +>>>>> /build/octave-statistics-1.4.2/inst/mvnrnd.m +***** shared m, n, C, rho + m = 10; n = 3; rho = 0.4; C = rho*ones(n, n) + (1 - rho)*eye(n); +***** assert(size(mvnrnd(0, C, m)), [m n]) +***** assert(size(mvnrnd(zeros(1, n), C, m)), [m n]) +***** assert(size(mvnrnd(zeros(n, 1), C, m)), [m n]) +***** assert(size(mvnrnd(zeros(m, n), C, m)), [m n]) +***** assert(size(mvnrnd(zeros(m, n), C)), [m n]) +***** assert(size(mvnrnd(zeros(1, n), C)), [1 n]) +***** assert(size(mvnrnd(zeros(n, 1), C)), [1 n]) +***** error(mvnrnd(zeros(m+1, n), C, m)) +***** error(mvnrnd(zeros(1, n+1), C, m)) +***** error(mvnrnd(zeros(n+1, 1), C, m)) +***** error(mvnrnd(zeros(m, n), eye(n+1), m)) +***** error(mvnrnd(zeros(m, n), eye(n+1, n), m)) +12 tests, 12 passed, 0 known failure, 0 skipped +[inst/gpinv.m] +>>>>> /build/octave-statistics-1.4.2/inst/gpinv.m +***** shared x,y1,y2,y3 + x = [-1, 0, 1/2, 1, 2]; + y1 = [NaN, 0, 0.6931471805599453, Inf, NaN]; + y2 = [NaN, 0, 1, Inf, NaN]; + y3 = [NaN, 0, 1/2, 1, NaN]; +***** assert (gpinv (x, zeros (1,5), ones (1,5), zeros (1,5)), y1) +***** assert (gpinv (x, 0, 1, zeros (1,5)), y1) +***** assert (gpinv (x, 0, ones (1,5), 0), y1) +***** assert (gpinv (x, zeros (1,5), 1, 0), y1) +***** assert (gpinv (x, 0, 1, 0), y1) +***** assert (gpinv (x, 0, 1, [0, 0, NaN, 0, 0]), [y1(1:2), NaN, y1(4:5)]) +***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], 0), [y1(1:2), NaN, y1(4:5)]) +***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 0), [y1(1:2), NaN, y1(4:5)]) +***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, 0), [y1(1:2), NaN, y1(4:5)]) +***** assert (gpinv (x, ones (1,5), ones (1,5), zeros (1,5)), y2) +***** assert (gpinv (x, 1, 1, zeros (1,5)), y2) +***** assert (gpinv (x, 1, ones (1,5), 0), y2) +***** assert (gpinv (x, ones (1,5), 1, 0), y2) +***** assert (gpinv (x, 1, 1, 0), y2) +***** assert (gpinv (x, 1, 1, [0, 0, NaN, 0, 0]), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, 1, [1, 1, NaN, 1, 1], 0), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, [1, 1, NaN, 1, 1], 1, 0), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv ([x(1:2), NaN, x(4:5)], 1, 1, 0), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, -ones (1,5), ones (1,5), zeros (1,5)), y3) +***** assert (gpinv (x, -1, 1, zeros (1,5)), y3) +***** assert (gpinv (x, -1, ones (1,5), 0), y3) +***** assert (gpinv (x, -ones (1,5), 1, 0), y3) +***** assert (gpinv (x, -1, 1, 0), y3) +***** assert (gpinv (x, -1, 1, [0, 0, NaN, 0, 0]), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (x, -1, [1, 1, NaN, 1, 1], 0), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (x, -[1, 1, NaN, 1, 1], 1, 0), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv ([x(1:2), NaN, x(4:5)], -1, 1, 0), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], 0, single (1), 0), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], single (0), 1, 0), single ([y1, NaN])) +***** assert (gpinv (single ([x, NaN]), 1, 1, 0), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], 1, 1, single (0)), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], 1, single (1), 0), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], single (1), 1, 0), single ([y2, NaN])) +***** assert (gpinv (single ([x, NaN]), -1, 1, 0), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], -1, 1, single (0)), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], -1, single (1), 0), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], single (-1), 1, 0), single ([y3, NaN])) +***** error gpinv () +***** error gpinv (1) +***** error gpinv (1,2) +***** error gpinv (1,2,3) +***** error gpinv (1,2,3,4,5) +***** error gpinv (ones (3), ones (2), ones (2), ones (2)) +***** error gpinv (ones (2), ones (3), ones (2), ones (2)) +***** error gpinv (ones (2), ones (2), ones (3), ones (2)) +***** error gpinv (ones (2), ones (2), ones (2), ones (3)) +***** error gpinv (i, 2, 2, 2) +***** error gpinv (2, i, 2, 2) +***** error gpinv (2, 2, i, 2) +***** error gpinv (2, 2, 2, i) +52 tests, 52 passed, 0 known failure, 0 skipped +[inst/squareform.m] +>>>>> /build/octave-statistics-1.4.2/inst/squareform.m +***** shared v, m + v = 1:6; + m = [0 1 2 3;1 0 4 5;2 4 0 6;3 5 6 0]; +***** assert (squareform (v), m) +***** assert (squareform (squareform (v)), v) +***** assert (squareform (m), v) +***** assert (squareform (v'), m) +***** assert (squareform (1), [0 1;1 0]) +***** assert (squareform (1, "tomatrix"), [0 1; 1 0]) +***** assert (squareform (0, "tovector"), zeros (1, 0)) +***** warning squareform ([0 1 2; 3 0 4; 5 6 0]); ***** test - sequence = [1, 2, 1, 1, 1, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 3, 3, 2, 3, 1, 3]; - transprob = [0.8, 0.2; 0.4, 0.6]; - outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; - vpath = hmmviterbi (sequence, transprob, outprob); - expected = [1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1]; - assert (vpath, expected); + for c = {@single, @double, @uint8, @uint32, @uint64} + f = c{1}; + assert (squareform (f (v)), f (m)) + assert (squareform (f (m)), f (v)) + endfor +9 tests, 9 passed, 0 known failure, 0 skipped +[inst/pdf.m] +>>>>> /build/octave-statistics-1.4.2/inst/pdf.m ***** test - sequence = {'A', 'B', 'A', 'A', 'A', 'B', 'B', 'A', 'B', 'C', 'C', 'C', 'C', 'B', 'C', 'A', 'A', 'A', 'A', 'C', 'C', 'B', 'C', 'A', 'C'}; - transprob = [0.8, 0.2; 0.4, 0.6]; - outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; - symbols = {'A', 'B', 'C'}; - statenames = {'One', 'Two'}; - vpath = hmmviterbi (sequence, transprob, outprob, 'symbols', symbols, 'statenames', statenames); - expected = {'One', 'One', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'One', 'Two', 'Two', 'Two', 'Two', 'One', 'One', 'One', 'One', 'One', 'One'}; - assert (vpath, expected); -2 tests, 2 passed, 0 known failure, 0 skipped + assert(pdf ('norm', 1, 0, 1), normpdf (1, 0, 1)) +1 test, 1 passed, 0 known failure, 0 skipped Checking C++ files ... Summary: 2437 tests, 2434 passed, 0 known failures, 3 skipped dh_installdocs -O--buildsystem=octave @@ -7282,12 +7317,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/79283/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/5804 and its subdirectories -I: Current time: Mon Aug 14 20:41:07 -12 2023 -I: pbuilder-time-stamp: 1692088867 +I: removing directory /srv/workspace/pbuilder/79283 and its subdirectories +I: Current time: Tue Sep 17 05:14:56 +14 2024 +I: pbuilder-time-stamp: 1726499696