Diff of the two buildlogs: -- --- b1/build.log 2023-08-15 09:01:14.359830542 +0000 +++ b2/build.log 2023-08-15 09:31:49.246115869 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Aug 14 20:34:46 -12 2023 -I: pbuilder-time-stamp: 1692088486 +I: Current time: Tue Aug 15 23:01:25 +14 2023 +I: pbuilder-time-stamp: 1692090085 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/buster-reproducible-base.tgz] I: copying local configuration @@ -18,7 +18,7 @@ I: Extracting source gpgv: unknown type of key resource 'trustedkeys.kbx' gpgv: keyblock resource '/root/.gnupg/trustedkeys.kbx': General error -gpgv: Signature made Thu Jan 3 23:11:20 2019 -12 +gpgv: Signature made Sat Jan 5 01:11:20 2019 +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.0-5.dsc @@ -32,136 +32,167 @@ 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/7303/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/3857/tmp/hooks/D01_modify_environment starting +debug: Running on virt32b. +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 Aug 15 23:01 /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/3857/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/3857/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='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='buster' - HOME='/root' - HOST_ARCH='armhf' + 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]="0" [2]="3" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.0.3(1)-release' + BUILDDIR=/build + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=buster + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='67e6830d97e1467cbad2906e8baa98ba' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - 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='7303' - PS1='# ' - PS2='> ' + INVOCATION_ID=86c4ef3fb7774db692b2d1c094b562fc + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + 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=3857 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.zq3Kq4JW/pbuilderrc_LNJS --distribution buster --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.zq3Kq4JW/b1 --logfile b1/build.log octave-statistics_1.4.0-5.dsc' - SUDO_GID='113' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + 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.zq3Kq4JW/pbuilderrc_tZl0 --distribution buster --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/buster-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.zq3Kq4JW/b2 --logfile b2/build.log octave-statistics_1.4.0-5.dsc' + SUDO_GID=112 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux virt64b 6.1.0-11-arm64 #1 SMP Debian 6.1.38-4 (2023-08-08) aarch64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-11-armmp-lpae #1 SMP Debian 6.1.38-4 (2023-08-08) armv7l GNU/Linux I: ls -l /bin total 3328 - -rwxr-xr-x 1 root root 767656 Apr 17 2019 bash - -rwxr-xr-x 3 root root 26052 Jul 10 2019 bunzip2 - -rwxr-xr-x 3 root root 26052 Jul 10 2019 bzcat - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2227 Jul 10 2019 bzdiff - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4877 Jun 24 2019 bzexe - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3641 Jul 10 2019 bzgrep - -rwxr-xr-x 3 root root 26052 Jul 10 2019 bzip2 - -rwxr-xr-x 1 root root 9636 Jul 10 2019 bzip2recover - lrwxrwxrwx 1 root root 6 Jul 10 2019 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Jul 10 2019 bzmore - -rwxr-xr-x 1 root root 22432 Feb 28 2019 cat - -rwxr-xr-x 1 root root 38868 Feb 28 2019 chgrp - -rwxr-xr-x 1 root root 38836 Feb 28 2019 chmod - -rwxr-xr-x 1 root root 42972 Feb 28 2019 chown - -rwxr-xr-x 1 root root 88376 Feb 28 2019 cp - -rwxr-xr-x 1 root root 75516 Jan 17 2019 dash - -rwxr-xr-x 1 root root 71648 Feb 28 2019 date - -rwxr-xr-x 1 root root 51212 Feb 28 2019 dd - -rwxr-xr-x 1 root root 55672 Feb 28 2019 df - -rwxr-xr-x 1 root root 88444 Feb 28 2019 dir - -rwxr-xr-x 1 root root 54872 Jan 9 2019 dmesg - lrwxrwxrwx 1 root root 8 Sep 26 2018 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Sep 26 2018 domainname -> hostname - -rwxr-xr-x 1 root root 22364 Feb 28 2019 echo - -rwxr-xr-x 1 root root 28 Jan 7 2019 egrep - -rwxr-xr-x 1 root root 18260 Feb 28 2019 false - -rwxr-xr-x 1 root root 28 Jan 7 2019 fgrep - -rwxr-xr-x 1 root root 47356 Jan 9 2019 findmnt - -rwsr-xr-x 1 root root 21980 Apr 22 2020 fusermount - -rwxr-xr-x 1 root root 124508 Jan 7 2019 grep - -rwxr-xr-x 2 root root 2345 Apr 15 2022 gunzip - -rwxr-xr-x 1 root root 6446 Apr 15 2022 gzexe - -rwxr-xr-x 1 root root 64232 Apr 15 2022 gzip - -rwxr-xr-x 1 root root 13784 Sep 26 2018 hostname - -rwxr-xr-x 1 root root 43044 Feb 28 2019 ln - -rwxr-xr-x 1 root root 34932 Jul 26 2018 login - -rwxr-xr-x 1 root root 88444 Feb 28 2019 ls - -rwxr-xr-x 1 root root 67036 Jan 9 2019 lsblk - -rwxr-xr-x 1 root root 47168 Feb 28 2019 mkdir - -rwxr-xr-x 1 root root 43040 Feb 28 2019 mknod - -rwxr-xr-x 1 root root 26552 Feb 28 2019 mktemp - -rwxr-xr-x 1 root root 26024 Jan 9 2019 more - -rwsr-xr-x 1 root root 34268 Jan 9 2019 mount - -rwxr-xr-x 1 root root 9688 Jan 9 2019 mountpoint - -rwxr-xr-x 1 root root 84284 Feb 28 2019 mv - lrwxrwxrwx 1 root root 8 Sep 26 2018 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Feb 14 2019 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 22416 Feb 28 2019 pwd - lrwxrwxrwx 1 root root 4 Apr 17 2019 rbash -> bash - -rwxr-xr-x 1 root root 26504 Feb 28 2019 readlink - -rwxr-xr-x 1 root root 42968 Feb 28 2019 rm - -rwxr-xr-x 1 root root 26496 Feb 28 2019 rmdir - -rwxr-xr-x 1 root root 14136 Jan 21 2019 run-parts - -rwxr-xr-x 1 root root 76012 Dec 22 2018 sed - lrwxrwxrwx 1 root root 4 Aug 6 20:28 sh -> dash - -rwxr-xr-x 1 root root 22384 Feb 28 2019 sleep - -rwxr-xr-x 1 root root 51124 Feb 28 2019 stty - -rwsr-xr-x 1 root root 42472 Jan 9 2019 su - -rwxr-xr-x 1 root root 22392 Feb 28 2019 sync - -rwxr-xr-x 1 root root 283324 Apr 23 2019 tar - -rwxr-xr-x 1 root root 9808 Jan 21 2019 tempfile - -rwxr-xr-x 1 root root 63464 Feb 28 2019 touch - -rwxr-xr-x 1 root root 18260 Feb 28 2019 true - -rwxr-xr-x 1 root root 9636 Apr 22 2020 ulockmgr_server - -rwsr-xr-x 1 root root 21976 Jan 9 2019 umount - -rwxr-xr-x 1 root root 22380 Feb 28 2019 uname - -rwxr-xr-x 2 root root 2345 Apr 15 2022 uncompress - -rwxr-xr-x 1 root root 88444 Feb 28 2019 vdir - -rwxr-xr-x 1 root root 21980 Jan 9 2019 wdctl - -rwxr-xr-x 1 root root 946 Jan 21 2019 which - lrwxrwxrwx 1 root root 8 Sep 26 2018 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1983 Apr 15 2022 zcat - -rwxr-xr-x 1 root root 1677 Apr 15 2022 zcmp - -rwxr-xr-x 1 root root 5897 Apr 15 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 15 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 15 2022 zfgrep - -rwxr-xr-x 1 root root 2080 Apr 15 2022 zforce - -rwxr-xr-x 1 root root 8048 Apr 15 2022 zgrep - -rwxr-xr-x 1 root root 2205 Apr 15 2022 zless - -rwxr-xr-x 1 root root 1841 Apr 15 2022 zmore - -rwxr-xr-x 1 root root 4576 Apr 15 2022 znew -I: user script /srv/workspace/pbuilder/7303/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 767656 Apr 18 2019 bash + -rwxr-xr-x 3 root root 26052 Jul 11 2019 bunzip2 + -rwxr-xr-x 3 root root 26052 Jul 11 2019 bzcat + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2227 Jul 11 2019 bzdiff + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4877 Jun 25 2019 bzexe + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3641 Jul 11 2019 bzgrep + -rwxr-xr-x 3 root root 26052 Jul 11 2019 bzip2 + -rwxr-xr-x 1 root root 9636 Jul 11 2019 bzip2recover + lrwxrwxrwx 1 root root 6 Jul 11 2019 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Jul 11 2019 bzmore + -rwxr-xr-x 1 root root 22432 Mar 1 2019 cat + -rwxr-xr-x 1 root root 38868 Mar 1 2019 chgrp + -rwxr-xr-x 1 root root 38836 Mar 1 2019 chmod + -rwxr-xr-x 1 root root 42972 Mar 1 2019 chown + -rwxr-xr-x 1 root root 88376 Mar 1 2019 cp + -rwxr-xr-x 1 root root 75516 Jan 18 2019 dash + -rwxr-xr-x 1 root root 71648 Mar 1 2019 date + -rwxr-xr-x 1 root root 51212 Mar 1 2019 dd + -rwxr-xr-x 1 root root 55672 Mar 1 2019 df + -rwxr-xr-x 1 root root 88444 Mar 1 2019 dir + -rwxr-xr-x 1 root root 54872 Jan 10 2019 dmesg + lrwxrwxrwx 1 root root 8 Sep 27 2018 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Sep 27 2018 domainname -> hostname + -rwxr-xr-x 1 root root 22364 Mar 1 2019 echo + -rwxr-xr-x 1 root root 28 Jan 8 2019 egrep + -rwxr-xr-x 1 root root 18260 Mar 1 2019 false + -rwxr-xr-x 1 root root 28 Jan 8 2019 fgrep + -rwxr-xr-x 1 root root 47356 Jan 10 2019 findmnt + -rwsr-xr-x 1 root root 21980 Apr 23 2020 fusermount + -rwxr-xr-x 1 root root 124508 Jan 8 2019 grep + -rwxr-xr-x 2 root root 2345 Apr 16 2022 gunzip + -rwxr-xr-x 1 root root 6446 Apr 16 2022 gzexe + -rwxr-xr-x 1 root root 64232 Apr 16 2022 gzip + -rwxr-xr-x 1 root root 13784 Sep 27 2018 hostname + -rwxr-xr-x 1 root root 43044 Mar 1 2019 ln + -rwxr-xr-x 1 root root 34932 Jul 27 2018 login + -rwxr-xr-x 1 root root 88444 Mar 1 2019 ls + -rwxr-xr-x 1 root root 67036 Jan 10 2019 lsblk + -rwxr-xr-x 1 root root 47168 Mar 1 2019 mkdir + -rwxr-xr-x 1 root root 43040 Mar 1 2019 mknod + -rwxr-xr-x 1 root root 26552 Mar 1 2019 mktemp + -rwxr-xr-x 1 root root 26024 Jan 10 2019 more + -rwsr-xr-x 1 root root 34268 Jan 10 2019 mount + -rwxr-xr-x 1 root root 9688 Jan 10 2019 mountpoint + -rwxr-xr-x 1 root root 84284 Mar 1 2019 mv + lrwxrwxrwx 1 root root 8 Sep 27 2018 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Feb 15 2019 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 22416 Mar 1 2019 pwd + lrwxrwxrwx 1 root root 4 Apr 18 2019 rbash -> bash + -rwxr-xr-x 1 root root 26504 Mar 1 2019 readlink + -rwxr-xr-x 1 root root 42968 Mar 1 2019 rm + -rwxr-xr-x 1 root root 26496 Mar 1 2019 rmdir + -rwxr-xr-x 1 root root 14136 Jan 22 2019 run-parts + -rwxr-xr-x 1 root root 76012 Dec 23 2018 sed + lrwxrwxrwx 1 root root 9 Aug 15 23:01 sh -> /bin/bash + -rwxr-xr-x 1 root root 22384 Mar 1 2019 sleep + -rwxr-xr-x 1 root root 51124 Mar 1 2019 stty + -rwsr-xr-x 1 root root 42472 Jan 10 2019 su + -rwxr-xr-x 1 root root 22392 Mar 1 2019 sync + -rwxr-xr-x 1 root root 283324 Apr 24 2019 tar + -rwxr-xr-x 1 root root 9808 Jan 22 2019 tempfile + -rwxr-xr-x 1 root root 63464 Mar 1 2019 touch + -rwxr-xr-x 1 root root 18260 Mar 1 2019 true + -rwxr-xr-x 1 root root 9636 Apr 23 2020 ulockmgr_server + -rwsr-xr-x 1 root root 21976 Jan 10 2019 umount + -rwxr-xr-x 1 root root 22380 Mar 1 2019 uname + -rwxr-xr-x 2 root root 2345 Apr 16 2022 uncompress + -rwxr-xr-x 1 root root 88444 Mar 1 2019 vdir + -rwxr-xr-x 1 root root 21980 Jan 10 2019 wdctl + -rwxr-xr-x 1 root root 946 Jan 22 2019 which + lrwxrwxrwx 1 root root 8 Sep 27 2018 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1983 Apr 16 2022 zcat + -rwxr-xr-x 1 root root 1677 Apr 16 2022 zcmp + -rwxr-xr-x 1 root root 5897 Apr 16 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 16 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 16 2022 zfgrep + -rwxr-xr-x 1 root root 2080 Apr 16 2022 zforce + -rwxr-xr-x 1 root root 8048 Apr 16 2022 zgrep + -rwxr-xr-x 1 root root 2205 Apr 16 2022 zless + -rwxr-xr-x 1 root root 1841 Apr 16 2022 zmore + -rwxr-xr-x 1 root root 4576 Apr 16 2022 znew +I: user script /srv/workspace/pbuilder/3857/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -556,7 +587,7 @@ Get: 350 http://deb.debian.org/debian buster/main armhf dh-octave-autopkgtest all 0.6.2 [8308 B] Get: 351 http://deb.debian.org/debian buster/main armhf dh-octave all 0.6.2 [19.9 kB] Get: 352 http://deb.debian.org/debian buster/main armhf octave-io armhf 2.4.12-2 [198 kB] -Fetched 112 MB in 2min 14s (835 kB/s) +Fetched 112 MB in 10s (11.3 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libbsd0:armhf. (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 ... 18932 files and directories currently installed.) @@ -2011,7 +2042,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/octave-statistics-1.4.0/ && 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.0-5_source.changes +I: user script /srv/workspace/pbuilder/3857/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for buster +I: user script /srv/workspace/pbuilder/3857/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/octave-statistics-1.4.0/ && 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.0-5_source.changes dpkg-buildpackage: info: source package octave-statistics dpkg-buildpackage: info: source version 1.4.0-5 dpkg-buildpackage: info: source distribution unstable @@ -2045,9 +2080,9 @@ octave --no-gui --no-history --silent --no-init-file --no-window-system /usr/share/dh-octave/install-pkg.m warning: pkg: creating the directory /build/octave-statistics-1.4.0/debian/octave-statistics/usr/share/octave/packages warning: pkg: creating the directory /build/octave-statistics-1.4.0/debian/octave-statistics/usr/lib/arm-linux-gnueabihf/octave/packages -checking build system type... aarch64-unknown-linux-gnu -checking host system type... aarch64-unknown-linux-gnu -checking target system type... aarch64-unknown-linux-gnu +checking build system type... armv7l-unknown-linux-gnueabihf +checking host system type... armv7l-unknown-linux-gnueabihf +checking target system type... armv7l-unknown-linux-gnueabihf checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out @@ -2068,7 +2103,7 @@ --norc \ --eval 'addpath ("../utils");' \ --eval 'conditional_installation ("../install-conditionally", "../inst", false, "../INDEX");' -error: writing file '/nonexistent/first-build/.octave_hist': No such file or directory +error: writing file '/nonexistent/second-build/.octave_hist': No such file or directory error: ignoring const execution_exception& while preparing to exit cp ../test/*.dat ../inst/test/ make[2]: Leaving directory '/build/octave-statistics-1.4.0/src' @@ -2079,776 +2114,6 @@ dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... -[inst/runstest.m] ->>>>> /build/octave-statistics-1.4.0/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/nakainv.m] ->>>>> /build/octave-statistics-1.4.0/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/gpinv.m] ->>>>> /build/octave-statistics-1.4.0/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, zeros (1,5), 1, 0), y1) -***** assert (gpinv (x, 0, ones (1,5), 0), y1) -***** assert (gpinv (x, 0, 1, zeros (1,5)), y1) -***** assert (gpinv (x, 0, 1, 0), y1) -***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, NaN, 0, 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, zeros (1,5), ones (1,5), ones (1,5)), y2) -***** assert (gpinv (x, zeros (1,5), 1, 1), y2) -***** assert (gpinv (x, 0, ones (1,5), 1), y2) -***** assert (gpinv (x, 0, 1, ones (1,5)), y2) -***** assert (gpinv (x, 0, 1, 1), y2) -***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 1), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], 1), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, 0, 1, [1, 1, NaN, 1, 1]), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, 1), [y2(1:2), NaN, y2(4:5)]) -***** assert (gpinv (x, zeros (1,5), ones (1,5), -ones (1,5)), y3) -***** assert (gpinv (x, zeros (1,5), 1, -1), y3) -***** assert (gpinv (x, 0, ones (1,5), -1), y3) -***** assert (gpinv (x, 0, 1, -ones (1,5)), y3) -***** assert (gpinv (x, 0, 1, -1), y3) -***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, -1), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], -1), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (x, 0, 1, -[1, 1, NaN, 1, 1]), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, -1), [y3(1:2), NaN, y3(4:5)]) -***** assert (gpinv (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], single (0), 1, 0), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], 0, single (1), 0), single ([y1, NaN])) -***** assert (gpinv ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) -***** assert (gpinv (single ([x, NaN]), 0, 1, 1), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], single (0), 1, 1), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], 0, single (1), 1), single ([y2, NaN])) -***** assert (gpinv ([x, NaN], 0, 1, single (1)), single ([y2, NaN])) -***** assert (gpinv (single ([x, NaN]), 0, 1, -1), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], single (0), 1, -1), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], 0, single (1), -1), single ([y3, NaN])) -***** assert (gpinv ([x, NaN], 0, 1, single (-1)), 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/trirnd.m] ->>>>> /build/octave-statistics-1.4.0/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/gmdistribution.m] ->>>>> /build/octave-statistics-1.4.0/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]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/tripdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/tripdf.m -***** shared x,y,deps - x = [-1, 0, 0.1, 0.5, 0.9, 1, 2] + 1; - y = [0, 0, 0.4, 2, 0.4, 0, 0]; - deps = 2*eps; -***** assert (tripdf (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, deps) -***** assert (tripdf (x, 1*ones (1,7), 2, 1.5), y, deps) -***** assert (tripdf (x, 1, 2*ones (1,7), 1.5), y, deps) -***** assert (tripdf (x, 1, 2, 1.5*ones (1,7)), y, deps) -***** assert (tripdf (x, 1, 2, 1.5), y, deps) -***** assert (tripdf (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], deps) -***** assert (tripdf (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], deps) -***** assert (tripdf (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], deps) -***** assert (tripdf ([x, NaN], 1, 2, 1.5), [y, NaN], deps) -***** assert (tripdf (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (tripdf ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (tripdf ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) -***** assert (tripdf ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) -***** error tripdf () -***** error tripdf (1) -***** error tripdf (1,2) -***** error tripdf (1,2,3) -***** error tripdf (1,2,3,4,5) -***** error tripdf (1, ones (3), ones (2), ones (2)) -***** error tripdf (1, ones (2), ones (3), ones (2)) -***** error tripdf (1, ones (2), ones (2), ones (3)) -***** error tripdf (i, 2, 2, 2) -***** error tripdf (2, i, 2, 2) -***** error tripdf (2, 2, i, 2) -***** error tripdf (2, 2, 2, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/grp2idx.m] ->>>>> /build/octave-statistics-1.4.0/inst/grp2idx.m -***** test - in = [true false false true]; - out = {[2; 1; 1; 2] {"0"; "1"} [false; true]}; - assert (nthargout (1:3, @grp2idx, in), out) - assert (nthargout (1:3, @grp2idx, in), nthargout (1:3, @grp2idx, in')) -***** test - assert (nthargout (1:3, @grp2idx, [false true]), - {[1; 2] {"0"; "1"} [false; true]}); - assert (nthargout (1:3, @grp2idx, [true false]), - {[2; 1] {"0"; "1"} [false; true]}); -***** assert (nthargout (1:3, @grp2idx, ["oct"; "sci"; "oct"; "oct"; "sci"]), - {[1; 2; 1; 1; 2] {"oct"; "sci"} ["oct"; "sci"]}); -***** assert (nthargout (1:3, @grp2idx, {"oct"; "sci"; "oct"; "oct"; "sci"}), - {[1; 2; 1; 1; 2] {"oct"; "sci"} {"oct"; "sci"}}); -***** assert (nthargout (1:3, @grp2idx, [ 1 -3 -2 -3 -3 2 1 -1 3 -3]), - {[4; 1; 2; 1; 1; 5; 4; 3; 6; 1] {"-3"; "-2"; "-1"; "1"; "2"; "3"} ... - [-3; -2; -1; 1; 2; 3]}); -***** assert (nthargout (1:3, @grp2idx, [2 2 3 NaN 2 3]), - {[1; 1; 2; NaN; 1; 2] {"2"; "3"} [2; 3]}) -***** assert (nthargout (1:3, @grp2idx, {"et" "sa" "sa" "" "et"}), - {[1; 2; 2; NaN; 1] {"et"; "sa"} {"et"; "sa"}}) -***** xtest <51928> assert (nthargout (1:3, @grp2idx, ["sci"; "oct"; "sci"; "oct"; "oct"]), - {[1; 2; 1; 2; 2] {"sci"; "oct"} ["sci"; "oct"]}); -!!!!! known bug: https://octave.org/testfailure/?51928 -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - (1) 2 1 Abs err 1 exceeds tol 0 by 1 - (2) 1 2 Abs err 1 exceeds tol 0 by 1 - (3) 2 1 Abs err 1 exceeds tol 0 by 1 - (4) 1 2 Abs err 1 exceeds tol 0 by 1 - (5) 1 2 Abs err 1 exceeds tol 0 by 1 - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] oct sci Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] sci oct Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] osccti soccit Strings don't match -***** xtest <51928> assert (nthargout (1:3, @grp2idx, {"sci"; "oct"; "sci"; "oct"; "oct"}), - {[1; 2; 1; 2; 2] {"sci"; "oct"} {"sci"; "oct"}}); -!!!!! known bug: https://octave.org/testfailure/?51928 -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - (1) 2 1 Abs err 1 exceeds tol 0 by 1 - (2) 1 2 Abs err 1 exceeds tol 0 by 1 - (3) 2 1 Abs err 1 exceeds tol 0 by 1 - (4) 1 2 Abs err 1 exceeds tol 0 by 1 - (5) 1 2 Abs err 1 exceeds tol 0 by 1 - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] oct sci Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] sci oct Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] oct sci Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] sci oct Strings don't match -***** xtest <51928> assert (nthargout (1:3, @grp2idx, {"sa" "et" "et" "" "sa"}), - {[1; 2; 2; NaN; 1] {"sa"; "et"} {"sa"; "et"}}) -!!!!! known bug: https://octave.org/testfailure/?51928 -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - (1) 2 1 Abs err 1 exceeds tol 0 by 1 - (2) 1 2 Abs err 1 exceeds tol 0 by 1 - (3) 1 2 Abs err 1 exceeds tol 0 by 1 - (5) 2 1 Abs err 1 exceeds tol 0 by 1 - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] et sa Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] sa et Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] et sa Strings don't match - -ASSERT errors for: assert (cond {i},expected {i},tol) - - Location | Observed | Expected | Reason - [] sa et Strings don't match -10 tests, 7 passed, 0 known failure, 3 skipped -[inst/tricdf.m] ->>>>> /build/octave-statistics-1.4.0/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.0/inst/triinv.m -***** shared x,y - x = [-1, 0, 0.02, 0.5, 0.98, 1, 2]; - y = [NaN, 0, 0.1, 0.5, 0.9, 1, NaN] + 1; -***** assert (triinv (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, eps) -***** assert (triinv (x, 1*ones (1,7), 2, 1.5), y, eps) -***** assert (triinv (x, 1, 2*ones (1,7), 1.5), y, eps) -***** assert (triinv (x, 1, 2, 1.5*ones (1,7)), y, eps) -***** assert (triinv (x, 1, 2, 1.5), y, eps) -***** assert (triinv (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], eps) -***** assert (triinv (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], eps) -***** assert (triinv (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], eps) -***** assert (triinv ([x, NaN], 1, 2, 1.5), [y, NaN], eps) -***** assert (triinv (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (triinv ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) -***** assert (triinv ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) -***** assert (triinv ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) -***** error triinv () -***** error triinv (1) -***** error triinv (1,2) -***** error triinv (1,2,3) -***** error triinv (1,2,3,4,5) -***** error triinv (1, ones (3), ones (2), ones (2)) -***** error triinv (1, ones (2), ones (3), ones (2)) -***** error triinv (1, ones (2), ones (2), ones (3)) -***** error triinv (i, 2, 2, 2) -***** error triinv (2, i, 2, 2) -***** error triinv (2, 2, i, 2) -***** error triinv (2, 2, 2, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/raylrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/mvnpdf.m] ->>>>> /build/octave-statistics-1.4.0/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/base/logit.m] ->>>>> /build/octave-statistics-1.4.0/inst/base/logit.m -***** 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) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/base/qqplot.m] ->>>>> /build/octave-statistics-1.4.0/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/ppplot.m] ->>>>> /build/octave-statistics-1.4.0/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.0/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/cloglog.m] ->>>>> /build/octave-statistics-1.4.0/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/probit.m] ->>>>> /build/octave-statistics-1.4.0/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/jackknife.m] ->>>>> /build/octave-statistics-1.4.0/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/bbspdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/bbspdf.m -***** shared x,y - x = [-1, 0, 1, 2, Inf]; - y = [0, 0, 0.3989422804014327, 0.1647717335503959, 0]; -***** assert (bbspdf (x, zeros (1,5), ones (1,5), ones (1,5)), y, eps) -***** assert (bbspdf (x, zeros (1,5), 1, 1), y, eps) -***** assert (bbspdf (x, 0, ones (1,5), 1), y, eps) -***** assert (bbspdf (x, 0, 1, ones (1,5)), y, eps) -***** assert (bbspdf (x, 0, 1, 1), y, eps) -***** assert (bbspdf (x, [0, 0, NaN, 0, 0], 1, 1), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf (x, 0, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf (x, 0, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) -***** assert (bbspdf ([x, NaN], 0, 1, 1), [y, NaN], eps) -***** assert (bbspdf (single ([x, NaN]), 0, 1, 1), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], single (0), 1, 1), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], 0, single (1), 1), single ([y, NaN]), eps('single')) -***** assert (bbspdf ([x, NaN], 0, 1, single (1)), 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, 2, 3, 4) -***** error bbspdf (1, i, 3, 4) -***** error bbspdf (1, 2, i, 4) -***** error bbspdf (1, 2, 3, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/tblwrite.m] ->>>>> /build/octave-statistics-1.4.0/inst/tblwrite.m -***** shared privpath - privpath = [fileparts(which('tblwrite')) filesep() 'private']; -***** test - addpath (privpath,'-end') - [d err] = tbl_delim (" "); - assert (d, " "); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("space"); - assert (d, " "); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("tab"); - assert (d, sprintf ("\t")); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("comma"); - assert (d, ","); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("semi"); - assert (d, ";"); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("bar"); - assert (d, "|"); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("x"); - assert (d, "x"); - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ('\r'); - assert (d, sprintf ('\r')) - assert (err, ""); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ("bars"); - assert (isnan (d)); - assert (! isempty (err)); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim (""); - assert (isnan (d)); - assert (! isempty (err)); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim (5); - assert (isnan (d)); - assert (! isempty (err)); - rmpath (privpath); -***** test - addpath (privpath,'-end') - [d err] = tbl_delim ({"."}); - assert (isnan (d)); - assert (! isempty (err)); - rmpath (privpath); -***** shared d, v, c, tempfilename - d = [1 2;3 4]; - v = ["a ";"bc"]; - c = ["de";"f "]; - tempfilename = tempname; -***** test - tblwrite (d, v, c, tempfilename); - [dt vt ct] = tblread (tempfilename, " "); - assert (dt, d); - assert (vt, v); - assert (ct, c); - delete (tempfilename); -***** test - tblwrite (d, v, c, tempfilename, " "); - [dt vt ct] = tblread (tempfilename, " "); - assert (dt, d); - assert (vt, v); - assert (ct, c); - delete (tempfilename); -***** test - tblwrite (d, v, c, tempfilename, "space"); - [dt vt ct] = tblread (tempfilename); - assert (dt, d); - assert (vt, v); - assert (ct, c); - delete (tempfilename); -***** test - tblwrite (d, v, c, tempfilename, "tab"); - [dt vt ct] = tblread (tempfilename, "tab"); - assert (dt, d); - assert (vt, v); - assert (ct, c); - delete (tempfilename); -***** test - tblwrite (d, v, c, tempfilename, "\t"); - [dt vt ct] = tblread (tempfilename, "\t"); - assert (dt, d); - assert (vt, v); - assert (ct, c); - delete (tempfilename); -17 tests, 17 passed, 0 known failure, 0 skipped -[inst/raylinv.m] ->>>>> /build/octave-statistics-1.4.0/inst/raylinv.m -***** test - 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 - 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/gevlike.m] ->>>>> /build/octave-statistics-1.4.0/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); -***** 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/combnk.m] ->>>>> /build/octave-statistics-1.4.0/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/iwishpdf.m] ->>>>> /build/octave-statistics-1.4.0/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/squareform.m] ->>>>> /build/octave-statistics-1.4.0/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/hmmviterbi.m] ->>>>> /build/octave-statistics-1.4.0/inst/hmmviterbi.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]; - 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/mvtrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/chi2stat.m] ->>>>> /build/octave-statistics-1.4.0/inst/chi2stat.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/lognstat.m] >>>>> /build/octave-statistics-1.4.0/inst/lognstat.m ***** test @@ -2867,533 +2132,6 @@ assert (m, expected_m, 0.001); assert (v, expected_v, 0.001); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/gevcdf.m] ->>>>> /build/octave-statistics-1.4.0/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/gevrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/tests/kolmogorov_smirnov_test.m] ->>>>> /build/octave-statistics-1.4.0/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/sign_test.m] ->>>>> /build/octave-statistics-1.4.0/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.m] ->>>>> /build/octave-statistics-1.4.0/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/z_test_2.m] ->>>>> /build/octave-statistics-1.4.0/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/kruskal_wallis_test.m] ->>>>> /build/octave-statistics-1.4.0/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/t_test.m] ->>>>> /build/octave-statistics-1.4.0/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, 1000*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, 1000*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, 1000*eps); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/regress.m] ->>>>> /build/octave-statistics-1.4.0/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 -1 test, 1 passed, 0 known failure, 0 skipped -[inst/fstat.m] ->>>>> /build/octave-statistics-1.4.0/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/nbinstat.m] ->>>>> /build/octave-statistics-1.4.0/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/expstat.m] ->>>>> /build/octave-statistics-1.4.0/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/nanvar.m] ->>>>> /build/octave-statistics-1.4.0/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/cmdscale.m] ->>>>> /build/octave-statistics-1.4.0/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/pdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/pdf.m -***** test - assert(pdf ('norm', 1, 0, 1), normpdf (1, 0, 1)) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/casewrite.m] ->>>>> /build/octave-statistics-1.4.0/inst/casewrite.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); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/iwishrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/hygestat.m] ->>>>> /build/octave-statistics-1.4.0/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/copularnd.m] ->>>>> /build/octave-statistics-1.4.0/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/mvtpdf.m] ->>>>> /build/octave-statistics-1.4.0/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/burrcdf.m] ->>>>> /build/octave-statistics-1.4.0/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/nansum.m] ->>>>> /build/octave-statistics-1.4.0/inst/nansum.m -***** assert (nansum ([2 4 NaN 7]), 13) -***** assert (nansum ([2 4 NaN Inf]), Inf) -***** assert (nansum ([1 NaN 3; NaN 5 6; 7 8 NaN]), [8 13 9]) -***** assert (nansum ([1 NaN 3; NaN 5 6; 7 8 NaN], 2), [4; 11; 15]) -***** assert (nansum (single ([1 NaN 3; NaN 5 6; 7 8 NaN])), single ([8 13 9])) -***** assert (nansum (single ([1 NaN 3; NaN 5 6; 7 8 NaN]), "double"), [8 13 9]) -***** assert (nansum (uint8 ([2 4 1 7])), 14) -***** 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/gpcdf.m] ->>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), 1, 0), y1, eps) -***** assert (gpcdf (x, 0, ones (1,6), 0), y1, eps) -***** assert (gpcdf (x, 0, 1, zeros (1,6)), y1, eps) -***** assert (gpcdf (x, 0, 1, 0), y1, eps) -***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, 0, NaN, 0, 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, zeros (1,6), ones (1,6), ones (1,6)), y2, eps) -***** assert (gpcdf (x, zeros (1,6), 1, 1), y2, eps) -***** assert (gpcdf (x, 0, ones (1,6), 1), y2, eps) -***** assert (gpcdf (x, 0, 1, ones (1,6)), y2, eps) -***** assert (gpcdf (x, 0, 1, 1), y2, eps) -***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, 1), [y2(1:3), NaN, y2(5:6)], eps) -***** assert (gpcdf (x, zeros (1,6), ones (1,6), -ones (1,6)), y3, eps) -***** assert (gpcdf (x, zeros (1,6), 1, -1), y3, eps) -***** assert (gpcdf (x, 0, ones (1,6), -1), y3, eps) -***** assert (gpcdf (x, 0, 1, -ones (1,6)), y3, eps) -***** assert (gpcdf (x, 0, 1, -1), y3, eps) -***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, -1), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], -1), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf (x, 0, 1, [-1, -1, -1, NaN, -1, -1]), [y1(1:3), NaN, y3(5:6)], eps) -***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, -1), [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], single (0), 1, 0), single ([y1, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, single (1), 0), single ([y1, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN]), eps('single')) -***** assert (gpcdf (single ([x, NaN]), 0, 1, 1), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], single (0), 1, 1), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, single (1), 1), single ([y2, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, 1, single (1)), single ([y2, NaN]), eps('single')) -***** assert (gpcdf (single ([x, NaN]), 0, 1, -1), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], single (0), 1, -1), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, single (1), -1), single ([y3, NaN]), eps('single')) -***** assert (gpcdf ([x, NaN], 0, 1, single (-1)), 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 (3), ones (2), ones (2)) -***** error gpcdf (ones (2), ones (2), ones (3), ones (2)) -***** error gpcdf (ones (2), ones (2), ones (2), ones (3)) -***** 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/normalise_distribution.m] ->>>>> /build/octave-statistics-1.4.0/inst/normalise_distribution.m -***** test - v = normalise_distribution ( [ 1 2 3 ], [], 1 ); - assert ( v, [ 0 0 0 ] ) -***** test - v = normalise_distribution ( [ 1 2 3 ], [], 2 ); - assert ( v, norminv ( [ 1 3 5 ] / 6 ), 3 * eps ) -***** test - v = normalise_distribution ( [ 1 2 3 ]', [], 2 ); - assert ( v, [ 0 0 0 ]' ) -***** test - v = normalise_distribution ( [ 1 2 3 ]' , [], 1 ); - assert ( v, norminv ( [ 1 3 5 ]' / 6 ), 3 * eps ) -***** test - v = normalise_distribution ( [ 1 1 2 2 3 3 ], [], 2 ); - assert ( v, norminv ( [ 3 3 7 7 11 11 ] / 12 ), 3 * eps ) -***** test - v = normalise_distribution ( [ 1 1 2 2 3 3 ]', [], 1 ); - assert ( v, norminv ( [ 3 3 7 7 11 11 ]' / 12 ), 3 * eps ) -***** test - A = randn ( 10 ); - N = normalise_distribution ( A, @normcdf ); - assert ( A, N, 1000 * eps ) -***** xtest - A = exprnd ( 1, 100 ); - N = normalise_distribution ( A, @ ( x ) ( expcdf ( x, 1 ) ) ); - assert ( mean ( vec ( N ) ), 0, 0.1 ) - assert ( std ( vec ( N ) ), 1, 0.1 ) -***** xtest - A = rand (1000,1); - N = normalise_distribution ( A, "unifcdf" ); - assert ( mean ( vec ( N ) ), 0, 0.1 ) - assert ( std ( vec ( N ) ), 1, 0.1 ) -***** xtest - A = [rand(1000,1), randn( 1000, 1)]; - N = normalise_distribution ( A, { "unifcdf", "normcdf" } ); - assert ( mean ( N ), [ 0, 0 ], 0.1 ) - assert ( std ( N ), [ 1, 1 ], 0.1 ) -***** xtest - A = [rand(1000,1), randn( 1000, 1), exprnd( 1, 1000, 1 )]'; - N = normalise_distribution ( A, { @unifcdf; @normcdf; @( x )( expcdf ( x, 1 ) ) }, 2 ); - assert ( mean ( N, 2 ), [ 0, 0, 0 ]', 0.1 ) - assert ( std ( N, [], 2 ), [ 1, 1, 1 ]', 0.1 ) -***** xtest - A = exprnd ( 1, 1000, 9 ); A ( 300 : 500, 4:6 ) = 17; - N = normalise_distribution ( A ); - assert ( mean ( N ), [ 0 0 0 0.38 0.38 0.38 0 0 0 ], 0.1 ); - assert ( var ( N ), [ 1 1 1 2.59 2.59 2.59 1 1 1 ], 0.1 ); -***** test - 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/princomp.m] >>>>> /build/octave-statistics-1.4.0/inst/princomp.m ***** shared COEFF,SCORE,latent,tsquare,m,x,R,V,lambda,i,S,F @@ -3446,140 +2184,151 @@ ***** assert(latent,[1],10*eps); ***** assert(tsquare,[0.5;0.5],10*eps) 19 tests, 19 passed, 0 known failure, 0 skipped -[inst/burrrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/stepwisefit.m] ->>>>> /build/octave-statistics-1.4.0/inst/stepwisefit.m +[inst/pdist2.m] +>>>>> /build/octave-statistics-1.4.0/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 - % 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)) + 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/copulapdf.m] ->>>>> /build/octave-statistics-1.4.0/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); +[inst/wishrnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/wishrnd.m +***** 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) +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/tstat.m] +>>>>> /build/octave-statistics-1.4.0/inst/tstat.m ***** 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/copulacdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/copulacdf.m + 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/cdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/cdf.m ***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - theta = [1; 2]; - p = copulacdf ("Clayton", x, theta); - expected_p = [0.1395; 0.1767]; - assert (p, expected_p, 0.001); + assert(cdf ('norm', 1, 0, 1), normcdf (1, 0, 1)) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/chi2stat.m] +>>>>> /build/octave-statistics-1.4.0/inst/chi2stat.m ***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - p = copulacdf ("Gumbel", x, 2); - expected_p = [0.1464; 0.1464]; - assert (p, expected_p, 0.001); + 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/bbsinv.m] +>>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), ones (1,6), ones (1,6)), y) +***** assert (bbsinv (x, zeros (1,6), 1, 1), y) +***** assert (bbsinv (x, 0, ones (1,6), 1), y) +***** assert (bbsinv (x, 0, 1, ones (1,6)), y) +***** assert (bbsinv (x, 0, 1, 1), y) +***** assert (bbsinv (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y(1:3), NaN, y(5:6)]) +***** assert (bbsinv ([x, NaN], 0, 1, 1), [y, NaN]) +***** assert (bbsinv (single ([x, NaN]), 0, 1, 1), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], single (0), 1, 1), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], 0, single (1), 1), single ([y, NaN])) +***** assert (bbsinv ([x, NaN], 0, 1, single (1)), 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, 2, 3, 4) +***** error bbsinv (1, i, 3, 4) +***** error bbsinv (1, 2, i, 4) +***** error bbsinv (1, 2, 3, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/binostat.m] +>>>>> /build/octave-statistics-1.4.0/inst/binostat.m ***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - theta = [1; 2]; - p = copulacdf ("Frank", x, theta); - expected_p = [0.0699; 0.0930]; - assert (p, expected_p, 0.001); + n = 1:6; + p = 0:0.2:1; + [m, v] = binostat (n, p); + expected_m = [0.00, 0.40, 1.20, 2.40, 4.00, 6.00]; + expected_v = [0.00, 0.32, 0.72, 0.96, 0.80, 0.00]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); ***** test - x = [0.2:0.2:0.6; 0.2:0.2:0.6]; - theta = [0.3; 0.7]; - p = copulacdf ("AMH", x, theta); - expected_p = [0.0629; 0.0959]; - assert (p, expected_p, 0.001); + n = 1:6; + [m, v] = binostat (n, 0.5); + expected_m = [0.50, 1.00, 1.50, 2.00, 2.50, 3.00]; + expected_v = [0.25, 0.50, 0.75, 1.00, 1.25, 1.50]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); ***** test - x = [0.2:0.2:0.6; 0.2:0.1:0.4]; - theta = [0.2, 0.1, 0.1, 0.05]; - p = copulacdf ("FGM", x, theta); - expected_p = [0.0558; 0.0293]; - assert (p, expected_p, 0.001); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/pdist.m] ->>>>> /build/octave-statistics-1.4.0/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/caseread.m] ->>>>> /build/octave-statistics-1.4.0/inst/caseread.m -***** shared n, casereadfile - n = ["a ";"bcd";"ef "]; - casereadfile = file_in_loadpath("test/caseread.dat"); -***** assert (caseread (casereadfile), n); -1 test, 1 passed, 0 known failure, 0 skipped + n = [-Inf -3 5 0.5 3 NaN 100, Inf]; + [m, v] = binostat (n, 0.5); + assert (isnan (m), [true true false true false true false false]) + assert (isnan (v), [true true false true false true false false]) + assert (m(end), Inf); + assert (v(end), Inf); +***** assert (nthargout (1:2, @binostat, 5, []), {[], []}) +***** assert (nthargout (1:2, @binostat, [], 5), {[], []}) +***** assert (nthargout (1:2, @binostat, "", 5), {[], []}) +***** assert (nthargout (1:2, @binostat, true, 5), {NaN, NaN}) +***** assert (nthargout (1:2, @binostat, 5, true), {5, 0}) +***** 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/burrinv.m] +>>>>> /build/octave-statistics-1.4.0/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/hist3.m] >>>>> /build/octave-statistics-1.4.0/inst/hist3.m ***** demo @@ -3758,245 +2507,418 @@ assert (c, exp_c) assert (nn, exp_nn, eps*100) 16 tests, 16 passed, 0 known failure, 0 skipped -[inst/binostat.m] ->>>>> /build/octave-statistics-1.4.0/inst/binostat.m +[inst/canoncorr.m] +>>>>> /build/octave-statistics-1.4.0/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); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/nbinstat.m] +>>>>> /build/octave-statistics-1.4.0/inst/nbinstat.m ***** test - n = 1:6; - p = 0:0.2:1; - [m, v] = binostat (n, p); - expected_m = [0.00, 0.40, 1.20, 2.40, 4.00, 6.00]; - expected_v = [0.00, 0.32, 0.72, 0.96, 0.80, 0.00]; + 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:6; - [m, v] = binostat (n, 0.5); - expected_m = [0.50, 1.00, 1.50, 2.00, 2.50, 3.00]; - expected_v = [0.25, 0.50, 0.75, 1.00, 1.25, 1.50]; + 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/copularnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/copularnd.m ***** test - n = [-Inf -3 5 0.5 3 NaN 100, Inf]; - [m, v] = binostat (n, 0.5); - assert (isnan (m), [true true false true false true false false]) - assert (isnan (v), [true true false true false true false false]) - assert (m(end), Inf); - assert (v(end), Inf); -***** assert (nthargout (1:2, @binostat, 5, []), {[], []}) -***** assert (nthargout (1:2, @binostat, [], 5), {[], []}) -***** assert (nthargout (1:2, @binostat, "", 5), {[], []}) -***** assert (nthargout (1:2, @binostat, true, 5), {NaN, NaN}) -***** assert (nthargout (1:2, @binostat, 5, true), {5, 0}) -***** 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/betastat.m] ->>>>> /build/octave-statistics-1.4.0/inst/betastat.m + theta = 0.5; + x = copularnd ("Gaussian", theta); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** 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); + theta = 0.5; + nu = 2; + x = copularnd ("t", theta, nu); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** 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); + theta = 0.5; + x = copularnd ("Clayton", theta); + assert (size (x), [1, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** 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/bbsrnd.m] ->>>>> /build/octave-statistics-1.4.0/inst/bbsrnd.m -***** assert (size (bbsrnd (0, 1, 1)), [1 1]) -***** assert (size (bbsrnd (zeros (2,1), 1, 1)), [2, 1]) -***** assert (size (bbsrnd (zeros (2,2), 1, 1)), [2, 2]) -***** assert (size (bbsrnd (0, ones (2,1), 1)), [2, 1]) -***** assert (size (bbsrnd (0, ones (2,2), 1)), [2, 2]) -***** assert (size (bbsrnd (0, 1, ones (2,1))), [2, 1]) -***** assert (size (bbsrnd (0, 1, ones (2,2))), [2, 2]) -***** assert (size (bbsrnd (0, 1, 1, 3)), [3, 3]) -***** assert (size (bbsrnd (0, 1, 1, [4 1])), [4, 1]) -***** assert (size (bbsrnd (0, 1, 1, 4, 1)), [4, 1]) -***** assert (class (bbsrnd (0,1,1)), "double") -***** assert (class (bbsrnd (single (0),1,1)), "single") -***** assert (class (bbsrnd (single ([0 0]),1,1)), "single") -***** assert (class (bbsrnd (0,single (1),1)), "single") -***** assert (class (bbsrnd (0,single ([1 1]),1)), "single") -***** assert (class (bbsrnd (0,1,single (1))), "single") -***** assert (class (bbsrnd (0,1,single ([1 1]))), "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 (ones (2),1,2, 3) -***** error bbsrnd (ones (2),1,2, [3, 2]) -***** error bbsrnd (ones (2),1,2, 3, 2) -32 tests, 32 passed, 0 known failure, 0 skipped -[inst/mnpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/mnpdf.m + theta = 0.5; + n = 2; + x = copularnd ("Clayton", theta, n); + assert (size (x), [n, 2]); + assert (all ((x >= 0) & (x <= 1))); ***** test - x = [1, 4, 2]; - p = [0.2, 0.5, 0.3]; - y = mnpdf (x, p); - assert (y, 0.11812, 0.001); + 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/normalise_distribution.m] +>>>>> /build/octave-statistics-1.4.0/inst/normalise_distribution.m ***** 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/nakarnd.m] ->>>>> /build/octave-statistics-1.4.0/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/unidstat.m] ->>>>> /build/octave-statistics-1.4.0/inst/unidstat.m + v = normalise_distribution ( [ 1 2 3 ], [], 1 ); + assert ( v, [ 0 0 0 ] ) +***** test + v = normalise_distribution ( [ 1 2 3 ], [], 2 ); + assert ( v, norminv ( [ 1 3 5 ] / 6 ), 3 * eps ) +***** test + v = normalise_distribution ( [ 1 2 3 ]', [], 2 ); + assert ( v, [ 0 0 0 ]' ) +***** test + v = normalise_distribution ( [ 1 2 3 ]' , [], 1 ); + assert ( v, norminv ( [ 1 3 5 ]' / 6 ), 3 * eps ) +***** test + v = normalise_distribution ( [ 1 1 2 2 3 3 ], [], 2 ); + assert ( v, norminv ( [ 3 3 7 7 11 11 ] / 12 ), 3 * eps ) +***** test + v = normalise_distribution ( [ 1 1 2 2 3 3 ]', [], 1 ); + assert ( v, norminv ( [ 3 3 7 7 11 11 ]' / 12 ), 3 * eps ) +***** test + A = randn ( 10 ); + N = normalise_distribution ( A, @normcdf ); + assert ( A, N, 1000 * eps ) +***** xtest + A = exprnd ( 1, 100 ); + N = normalise_distribution ( A, @ ( x ) ( expcdf ( x, 1 ) ) ); + assert ( mean ( vec ( N ) ), 0, 0.1 ) + assert ( std ( vec ( N ) ), 1, 0.1 ) +***** xtest + A = rand (1000,1); + N = normalise_distribution ( A, "unifcdf" ); + assert ( mean ( vec ( N ) ), 0, 0.1 ) + assert ( std ( vec ( N ) ), 1, 0.1 ) +***** xtest + A = [rand(1000,1), randn( 1000, 1)]; + N = normalise_distribution ( A, { "unifcdf", "normcdf" } ); + assert ( mean ( N ), [ 0, 0 ], 0.1 ) + assert ( std ( N ), [ 1, 1 ], 0.1 ) +***** xtest + A = [rand(1000,1), randn( 1000, 1), exprnd( 1, 1000, 1 )]'; + N = normalise_distribution ( A, { @unifcdf; @normcdf; @( x )( expcdf ( x, 1 ) ) }, 2 ); + assert ( mean ( N, 2 ), [ 0, 0, 0 ]', 0.1 ) + assert ( std ( N, [], 2 ), [ 1, 1, 1 ]', 0.1 ) +***** xtest + A = exprnd ( 1, 1000, 9 ); A ( 300 : 500, 4:6 ) = 17; + N = normalise_distribution ( A ); + assert ( mean ( N ), [ 0 0 0 0.38 0.38 0.38 0 0 0 ], 0.1 ); + assert ( var ( N ), [ 1 1 1 2.59 2.59 2.59 1 1 1 ], 0.1 ); +***** test + 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/gmdistribution.m] +>>>>> /build/octave-statistics-1.4.0/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]); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/tripdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/tripdf.m +***** shared x,y,deps + x = [-1, 0, 0.1, 0.5, 0.9, 1, 2] + 1; + y = [0, 0, 0.4, 2, 0.4, 0, 0]; + deps = 2*eps; +***** assert (tripdf (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, deps) +***** assert (tripdf (x, 1*ones (1,7), 2, 1.5), y, deps) +***** assert (tripdf (x, 1, 2*ones (1,7), 1.5), y, deps) +***** assert (tripdf (x, 1, 2, 1.5*ones (1,7)), y, deps) +***** assert (tripdf (x, 1, 2, 1.5), y, deps) +***** assert (tripdf (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], deps) +***** assert (tripdf (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], deps) +***** assert (tripdf (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], deps) +***** assert (tripdf ([x, NaN], 1, 2, 1.5), [y, NaN], deps) +***** assert (tripdf (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (tripdf ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (tripdf ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) +***** assert (tripdf ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) +***** error tripdf () +***** error tripdf (1) +***** error tripdf (1,2) +***** error tripdf (1,2,3) +***** error tripdf (1,2,3,4,5) +***** error tripdf (1, ones (3), ones (2), ones (2)) +***** error tripdf (1, ones (2), ones (3), ones (2)) +***** error tripdf (1, ones (2), ones (2), ones (3)) +***** error tripdf (i, 2, 2, 2) +***** error tripdf (2, i, 2, 2) +***** error tripdf (2, 2, i, 2) +***** error tripdf (2, 2, 2, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/tests/z_test_2.m] +>>>>> /build/octave-statistics-1.4.0/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.0/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/sign_test.m] +>>>>> /build/octave-statistics-1.4.0/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.0/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/t_test.m] +>>>>> /build/octave-statistics-1.4.0/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, 1000*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, 1000*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, 1000*eps); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/tests/kolmogorov_smirnov_test.m] +>>>>> /build/octave-statistics-1.4.0/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/expstat.m] +>>>>> /build/octave-statistics-1.4.0/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/raylrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/hygestat.m] +>>>>> /build/octave-statistics-1.4.0/inst/hygestat.m +***** test + t = 4:9; + m = 0:5; 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); + [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); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/gprnd.m] ->>>>> /build/octave-statistics-1.4.0/inst/gprnd.m -***** assert (size (gprnd (0,1,0)), [1, 1]) -***** assert (size (gprnd (zeros (2,1), 1,0)), [2, 1]) -***** assert (size (gprnd (zeros (2,2), 1,0)), [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 (0,1, zeros (2,1))), [2, 1]) -***** assert (size (gprnd (0,1, zeros (2,2))), [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 (0,1,1)), [1, 1]) -***** assert (size (gprnd (zeros (2,1), 1,1)), [2, 1]) -***** assert (size (gprnd (zeros (2,2), 1,1)), [2, 2]) -***** assert (size (gprnd (0, ones (2,1), 1)), [2, 1]) -***** assert (size (gprnd (0, ones (2,2), 1)), [2, 2]) -***** assert (size (gprnd (0,1, ones (2,1))), [2, 1]) -***** assert (size (gprnd (0,1, ones (2,2))), [2, 2]) -***** assert (size (gprnd (0,1, 1, 3)), [3, 3]) -***** assert (size (gprnd (0,1, 1, [4 1])), [4, 1]) -***** assert (size (gprnd (0,1, 1, 4, 1)), [4, 1]) -***** assert (size (gprnd (0,1,-1)), [1, 1]) -***** assert (size (gprnd (zeros (2,1), -1,1)), [2, 1]) -***** assert (size (gprnd (zeros (2,2), -1,1)), [2, 2]) -***** assert (size (gprnd (0, ones (2,1), -1)), [2, 1]) -***** assert (size (gprnd (0, ones (2,2), -1)), [2, 2]) -***** assert (size (gprnd (0,1, -ones (2,1))), [2, 1]) -***** assert (size (gprnd (0,1, -ones (2,2))), [2, 2]) -***** assert (size (gprnd (0,1, -1, 3)), [3, 3]) -***** assert (size (gprnd (0,1, -1, [4 1])), [4, 1]) -***** assert (size (gprnd (0,1, -1, 4, 1)), [4, 1]) -***** assert (class (gprnd (0,1,0)), "double") -***** assert (class (gprnd (single (0),1,0)), "single") -***** assert (class (gprnd (single ([0 0]),1,0)), "single") -***** assert (class (gprnd (0,single (1),0)), "single") -***** assert (class (gprnd (0,single ([1 1]),0)), "single") -***** assert (class (gprnd (0,1,single (0))), "single") -***** assert (class (gprnd (0,1,single ([0 0]))), "single") -***** error gprnd () -***** error gprnd (1) -***** error gprnd (1,2) -***** error gprnd (zeros (3), ones (2), zeros (2)) -***** error gprnd (zeros (2), ones (3), zeros (2)) -***** error gprnd (zeros (2), ones (2), zeros (3)) -***** 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 (zeros (2),1,0, 3) -***** error gprnd (zeros (2),1,0, [3, 2]) -***** error gprnd (zeros (2),1,0, 3, 2) -52 tests, 52 passed, 0 known failure, 0 skipped -[inst/mahal.m] ->>>>> /build/octave-statistics-1.4.0/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/mvnrnd.m] ->>>>> /build/octave-statistics-1.4.0/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 + 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/copulapdf.m] +>>>>> /build/octave-statistics-1.4.0/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/nakainv.m] +>>>>> /build/octave-statistics-1.4.0/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/binotest.m] >>>>> /build/octave-statistics-1.4.0/inst/binotest.m ***** demo @@ -4019,260 +2941,250 @@ [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/gevstat.m] ->>>>> /build/octave-statistics-1.4.0/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/tblread.m] ->>>>> /build/octave-statistics-1.4.0/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/crossval.m] ->>>>> /build/octave-statistics-1.4.0/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.0/debian/octave-statistics/usr/share/octave/packages/statistics-1.4.0/fisheriris.txt' found by searching load path -1 test, 1 passed, 0 known failure, 0 skipped -[inst/normstat.m] ->>>>> /build/octave-statistics-1.4.0/inst/normstat.m +[inst/mvtrnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/mvtrnd.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); + sigma = [1, 0.5; 0.5, 1]; + nu = 3; + n = 10; + x = mvtrnd (sigma, nu, n); + assert (size (x), [10, 2]); ***** 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); + 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/raylstat.m] ->>>>> /build/octave-statistics-1.4.0/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/sigma_pts.m] ->>>>> /build/octave-statistics-1.4.0/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/wblstat.m] ->>>>> /build/octave-statistics-1.4.0/inst/wblstat.m +[inst/gppdf.m] +>>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), 1, 0), y1, eps) +***** assert (gppdf (x, 0, ones (1,6), 0), y1, eps) +***** assert (gppdf (x, 0, 1, zeros (1,6)), y1, eps) +***** assert (gppdf (x, 0, 1, 0), y1, eps) +***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, 0, NaN, 0, 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, zeros (1,6), ones (1,6), ones (1,6)), y2, eps) +***** assert (gppdf (x, zeros (1,6), 1, 1), y2, eps) +***** assert (gppdf (x, 0, ones (1,6), 1), y2, eps) +***** assert (gppdf (x, 0, 1, ones (1,6)), y2, eps) +***** assert (gppdf (x, 0, 1, 1), y2, eps) +***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, 1), [y2(1:3), NaN, y2(5:6)]) +***** assert (gppdf (x, zeros (1,6), ones (1,6), -ones (1,6)), y3, eps) +***** assert (gppdf (x, zeros (1,6), 1, -1), y3, eps) +***** assert (gppdf (x, 0, ones (1,6), -1), y3, eps) +***** assert (gppdf (x, 0, 1, -ones (1,6)), y3, eps) +***** assert (gppdf (x, 0, 1, -1), y3, eps) +***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, -1), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], -1), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (x, 0, 1, [-1, -1, -1, NaN, -1, -1]), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, -1), [y3(1:3), NaN, y3(5:6)]) +***** assert (gppdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], single (0), 1, 0), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], 0, single (1), 0), single ([y1, NaN])) +***** assert (gppdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) +***** assert (gppdf (single ([x, NaN]), 0, 1, 1), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], single (0), 1, 1), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], 0, single (1), 1), single ([y2, NaN])) +***** assert (gppdf ([x, NaN], 0, 1, single (1)), single ([y2, NaN])) +***** assert (gppdf (single ([x, NaN]), 0, 1, -1), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], single (0), 1, -1), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], 0, single (1), -1), single ([y3, NaN])) +***** assert (gppdf ([x, NaN], 0, 1, single (-1)), 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 (3), ones (2), ones (2)) +***** error gppdf (1, ones (2), ones (3), ones (2)) +***** error gppdf (1, ones (2), ones (2), ones (3)) +***** 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/gevlike.m] +>>>>> /build/octave-statistics-1.4.0/inst/gevlike.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); + 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 - 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/gevfit.m] ->>>>> /build/octave-statistics-1.4.0/inst/gevfit.m + 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); ***** 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/raylcdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/raylcdf.m + 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/gpcdf.m] +>>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), 1, 0), y1, eps) +***** assert (gpcdf (x, 0, ones (1,6), 0), y1, eps) +***** assert (gpcdf (x, 0, 1, zeros (1,6)), y1, eps) +***** assert (gpcdf (x, 0, 1, 0), y1, eps) +***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, 0, NaN, 0, 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, zeros (1,6), ones (1,6), ones (1,6)), y2, eps) +***** assert (gpcdf (x, zeros (1,6), 1, 1), y2, eps) +***** assert (gpcdf (x, 0, ones (1,6), 1), y2, eps) +***** assert (gpcdf (x, 0, 1, ones (1,6)), y2, eps) +***** assert (gpcdf (x, 0, 1, 1), y2, eps) +***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, 1), [y2(1:3), NaN, y2(5:6)], eps) +***** assert (gpcdf (x, zeros (1,6), ones (1,6), -ones (1,6)), y3, eps) +***** assert (gpcdf (x, zeros (1,6), 1, -1), y3, eps) +***** assert (gpcdf (x, 0, ones (1,6), -1), y3, eps) +***** assert (gpcdf (x, 0, 1, -ones (1,6)), y3, eps) +***** assert (gpcdf (x, 0, 1, -1), y3, eps) +***** assert (gpcdf (x, [0, 0, 0, NaN, 0, 0], 1, -1), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf (x, 0, [1, 1, 1, NaN, 1, 1], -1), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf (x, 0, 1, [-1, -1, -1, NaN, -1, -1]), [y1(1:3), NaN, y3(5:6)], eps) +***** assert (gpcdf ([x(1:3), NaN, x(5:6)], 0, 1, -1), [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], single (0), 1, 0), single ([y1, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, single (1), 0), single ([y1, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN]), eps('single')) +***** assert (gpcdf (single ([x, NaN]), 0, 1, 1), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], single (0), 1, 1), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, single (1), 1), single ([y2, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, 1, single (1)), single ([y2, NaN]), eps('single')) +***** assert (gpcdf (single ([x, NaN]), 0, 1, -1), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], single (0), 1, -1), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, single (1), -1), single ([y3, NaN]), eps('single')) +***** assert (gpcdf ([x, NaN], 0, 1, single (-1)), 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 (3), ones (2), ones (2)) +***** error gpcdf (ones (2), ones (2), ones (3), ones (2)) +***** error gpcdf (ones (2), ones (2), ones (2), ones (3)) +***** 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/mvnrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/raylpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/raylpdf.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); + y = raylpdf (x, sigma); + expected_y = [0.0000, 0.1212, 0.1051, 0.0874, 0.0738, 0.0637]; + assert (y, expected_y, 0.001); ***** 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); + y = raylpdf (x, 0.5); + 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/cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/cdf.m +[inst/squareform.m] +>>>>> /build/octave-statistics-1.4.0/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 - assert(cdf ('norm', 1, 0, 1), normcdf (1, 0, 1)) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/hmmgenerate.m] ->>>>> /build/octave-statistics-1.4.0/inst/hmmgenerate.m + 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/hmmviterbi.m] +>>>>> /build/octave-statistics-1.4.0/inst/hmmviterbi.m ***** test - len = 25; + 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]; - [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)); + 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 - len = 25; + 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'}; - [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/gamstat.m] ->>>>> /build/octave-statistics-1.4.0/inst/gamstat.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]; - 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]; - assert (m, expected_m, 0.001); - assert (v, expected_v, 0.001); + 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/wishpdf.m] ->>>>> /build/octave-statistics-1.4.0/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/kmeans.m] >>>>> /build/octave-statistics-1.4.0/inst/kmeans.m ***** error kmeans (rand (3,2), 4); @@ -4356,33 +3268,46 @@ plot (centers (:, 1), centers (:, 2), 'kv', 'markersize', 10); hold off; 31 tests, 31 passed, 0 known failure, 0 skipped -[inst/pdist2.m] ->>>>> /build/octave-statistics-1.4.0/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/poisstat.m] ->>>>> /build/octave-statistics-1.4.0/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/burrcdf.m] +>>>>> /build/octave-statistics-1.4.0/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/iwishrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/bbscdf.m] >>>>> /build/octave-statistics-1.4.0/inst/bbscdf.m ***** shared x,y @@ -4414,293 +3339,320 @@ ***** error bbscdf (1, 2, i, 4) ***** error bbscdf (1, 2, 3, i) 25 tests, 25 passed, 0 known failure, 0 skipped -[inst/gevfit_lmom.m] ->>>>> /build/octave-statistics-1.4.0/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/ttest.m] ->>>>> /build/octave-statistics-1.4.0/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/gevinv.m] ->>>>> /build/octave-statistics-1.4.0/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/raylpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/raylpdf.m -***** test - x = 0:0.5:2.5; - sigma = 1:6; - y = raylpdf (x, sigma); - expected_y = [0.0000, 0.1212, 0.1051, 0.0874, 0.0738, 0.0637]; - assert (y, expected_y, 0.001); -***** test - x = 0:0.5:2.5; - y = raylpdf (x, 0.5); - 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/nakapdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/nakapdf.m +[inst/nakacdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/nakacdf.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) + 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/burrinv.m] ->>>>> /build/octave-statistics-1.4.0/inst/burrinv.m +[inst/bbspdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/bbspdf.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/bbsinv.m] ->>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), ones (1,6), ones (1,6)), y) -***** assert (bbsinv (x, zeros (1,6), 1, 1), y) -***** assert (bbsinv (x, 0, ones (1,6), 1), y) -***** assert (bbsinv (x, 0, 1, ones (1,6)), y) -***** assert (bbsinv (x, 0, 1, 1), y) -***** assert (bbsinv (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y(1:3), NaN, y(5:6)]) -***** assert (bbsinv ([x, NaN], 0, 1, 1), [y, NaN]) -***** assert (bbsinv (single ([x, NaN]), 0, 1, 1), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], single (0), 1, 1), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], 0, single (1), 1), single ([y, NaN])) -***** assert (bbsinv ([x, NaN], 0, 1, single (1)), 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, 2, 3, 4) -***** error bbsinv (1, i, 3, 4) -***** error bbsinv (1, 2, i, 4) -***** error bbsinv (1, 2, 3, i) + x = [-1, 0, 1, 2, Inf]; + y = [0, 0, 0.3989422804014327, 0.1647717335503959, 0]; +***** assert (bbspdf (x, zeros (1,5), ones (1,5), ones (1,5)), y, eps) +***** assert (bbspdf (x, zeros (1,5), 1, 1), y, eps) +***** assert (bbspdf (x, 0, ones (1,5), 1), y, eps) +***** assert (bbspdf (x, 0, 1, ones (1,5)), y, eps) +***** assert (bbspdf (x, 0, 1, 1), y, eps) +***** assert (bbspdf (x, [0, 0, NaN, 0, 0], 1, 1), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf (x, 0, [1, 1, NaN, 1, 1], 1), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf (x, 0, 1, [1, 1, NaN, 1, 1]), [y(1:2), NaN, y(4:5)], eps) +***** assert (bbspdf ([x, NaN], 0, 1, 1), [y, NaN], eps) +***** assert (bbspdf (single ([x, NaN]), 0, 1, 1), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], single (0), 1, 1), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], 0, single (1), 1), single ([y, NaN]), eps('single')) +***** assert (bbspdf ([x, NaN], 0, 1, single (1)), 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, 2, 3, 4) +***** error bbspdf (1, i, 3, 4) +***** error bbspdf (1, 2, i, 4) +***** error bbspdf (1, 2, 3, i) 25 tests, 25 passed, 0 known failure, 0 skipped -[inst/mnrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/burrpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/burrpdf.m +[inst/tricdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/tricdf.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/tstat.m] ->>>>> /build/octave-statistics-1.4.0/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/unifstat.m] ->>>>> /build/octave-statistics-1.4.0/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/distributions/lognrnd.m] ->>>>> /build/octave-statistics-1.4.0/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) + 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/distributions/logistic_cdf.m] +>>>>> /build/octave-statistics-1.4.0/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/unidpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/unidpdf.m +***** shared x,y + x = [-1 0 1 2 10 11]; + y = [0 0 0.1 0.1 0.1 0]; +***** assert (unidpdf (x, 10*ones (1,6)), y) +***** assert (unidpdf (x, 10), y) +***** assert (unidpdf (x, 10*[0 NaN 1 1 1 1]), [NaN NaN y(3:6)]) +***** assert (unidpdf ([x, NaN], 10), [y, NaN]) +***** assert (unidpdf (single ([x, NaN]), 10), single ([y, NaN])) +***** assert (unidpdf ([x, NaN], single (10)), single ([y, NaN])) +***** error unidpdf () +***** error unidpdf (1) +***** error unidpdf (1,2,3) +***** error unidpdf (ones (3), ones (2)) +***** error unidpdf (ones (2), ones (3)) +***** error unidpdf (i, 2) +***** error unidpdf (2, i) +13 tests, 13 passed, 0 known failure, 0 skipped +[inst/distributions/chi2cdf.m] +>>>>> /build/octave-statistics-1.4.0/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/norminv.m] +>>>>> /build/octave-statistics-1.4.0/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/frnd.m] +>>>>> /build/octave-statistics-1.4.0/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/geornd.m] ->>>>> /build/octave-statistics-1.4.0/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) +[inst/distributions/gamrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/nbininv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/nbininv.m +***** shared x + x = [-1 0 3/4 1 2]; +***** assert (nbininv (x, ones (1,5), 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (nbininv (x, 1, 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (nbininv (x, ones (1,5), 0.5), [NaN 0 1 Inf NaN]) +***** assert (nbininv (x, [1 0 NaN Inf 1], 0.5), [NaN NaN NaN NaN NaN]) +***** assert (nbininv (x, [1 0 1.5 Inf 1], 0.5), [NaN NaN 2 NaN NaN]) +***** assert (nbininv (x, 1, 0.5*[1 -Inf NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (nbininv ([x(1:2) NaN x(4:5)], 1, 0.5), [NaN 0 NaN Inf NaN]) +***** assert (nbininv ([x, NaN], 1, 0.5), [NaN 0 1 Inf NaN NaN]) +***** assert (nbininv (single ([x, NaN]), 1, 0.5), single ([NaN 0 1 Inf NaN NaN])) +***** assert (nbininv ([x, NaN], single (1), 0.5), single ([NaN 0 1 Inf NaN NaN])) +***** assert (nbininv ([x, NaN], 1, single (0.5)), single ([NaN 0 1 Inf NaN NaN])) +***** shared y, tol + y = magic (3) + 1; + tol = 1; +***** assert (nbininv (nbincdf (1:10, 3, 0.1), 3, 0.1), 1:10, tol) +***** assert (nbininv (nbincdf (1:10, 3./(1:10), 0.1), 3./(1:10), 0.1), 1:10, tol) +***** assert (nbininv (nbincdf (y, 3./y, 1./y), 3./y, 1./y), y, tol) +***** error nbininv () +***** error nbininv (1) +***** error nbininv (1,2) +***** error nbininv (1,2,3,4) +***** error nbininv (ones (3), ones (2), ones (2)) +***** error nbininv (ones (2), ones (3), ones (2)) +***** error nbininv (ones (2), ones (2), ones (3)) +***** error nbininv (i, 2, 2) +***** error nbininv (2, i, 2) +***** error nbininv (2, 2, i) +24 tests, 24 passed, 0 known failure, 0 skipped +[inst/distributions/poissinv.m] +>>>>> /build/octave-statistics-1.4.0/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/tinv.m] +>>>>> /build/octave-statistics-1.4.0/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/betainv.m] +>>>>> /build/octave-statistics-1.4.0/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/binoinv.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/binoinv.m @@ -4738,75 +3690,54 @@ ***** error binoinv (2, i, 2) ***** error binoinv (2, 2, i) 23 tests, 23 passed, 0 known failure, 0 skipped -[inst/distributions/tpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/tpdf.m -***** test - x = rand (10,1); - y = 1./(pi * (1 + x.^2)); - assert (tpdf (x, 1), y, 5*eps); -***** shared x,y - x = [-Inf 0 0.5 1 Inf]; - y = 1./(pi * (1 + x.^2)); -***** assert (tpdf (x, ones (1,5)), y, eps) -***** assert (tpdf (x, 1), y, eps) -***** assert (tpdf (x, [0 NaN 1 1 1]), [NaN NaN y(3:5)], eps) -***** assert (tpdf ([x, NaN], 1), [y, NaN], eps) -***** assert (tpdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) -***** assert (tpdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) -***** error tpdf () -***** error tpdf (1) -***** error tpdf (1,2,3) -***** error tpdf (ones (3), ones (2)) -***** error tpdf (ones (2), ones (3)) -***** error tpdf (i, 2) -***** error tpdf (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/wblpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/wblpdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = [0, exp(-x(2:4)), NaN]; -***** assert (wblpdf (x, ones (1,5), ones (1,5)), y) -***** assert (wblpdf (x, 1, ones (1,5)), y) -***** assert (wblpdf (x, ones (1,5), 1), y) -***** assert (wblpdf (x, [0 NaN Inf 1 1], 1), [NaN NaN NaN y(4:5)]) -***** assert (wblpdf (x, 1, [0 NaN Inf 1 1]), [NaN NaN NaN y(4:5)]) -***** assert (wblpdf ([x, NaN], 1, 1), [y, NaN]) -***** assert (wblpdf (single ([x, NaN]), 1, 1), single ([y, NaN])) -***** assert (wblpdf ([x, NaN], single (1), 1), single ([y, NaN])) -***** assert (wblpdf ([x, NaN], 1, single (1)), single ([y, NaN])) -***** error wblpdf () -***** error wblpdf (1,2,3,4) -***** error wblpdf (ones (3), ones (2), ones (2)) -***** error wblpdf (ones (2), ones (3), ones (2)) -***** error wblpdf (ones (2), ones (2), ones (3)) -***** error wblpdf (i, 2, 2) -***** error wblpdf (2, i, 2) -***** error wblpdf (2, 2, i) -17 tests, 17 passed, 0 known failure, 0 skipped -[inst/distributions/betacdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/betacdf.m +[inst/distributions/geornd.m] +>>>>> /build/octave-statistics-1.4.0/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/cauchy_cdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_cdf.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 + y = 1/pi * atan ((x-1) / 2) + 1/2; +***** assert (cauchy_cdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (cauchy_cdf (x, 1, 2*ones (1,5)), y) +***** assert (cauchy_cdf (x, ones (1,5), 2), y) +***** assert (cauchy_cdf (x, [-Inf 1 NaN 1 Inf], 2), [NaN y(2) NaN y(4) NaN]) +***** assert (cauchy_cdf (x, 1, 2*[0 1 NaN 1 Inf]), [NaN y(2) NaN y(4) NaN]) +***** assert (cauchy_cdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) +***** assert (cauchy_cdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (cauchy_cdf (single ([x, NaN]), 1, 2), single ([y, NaN]), eps ("single")) +***** assert (cauchy_cdf ([x, NaN], single (1), 2), single ([y, NaN]), eps ("single")) +***** assert (cauchy_cdf ([x, NaN], 1, single (2)), single ([y, NaN]), eps ("single")) +***** error cauchy_cdf () +***** error cauchy_cdf (1,2) +***** error cauchy_cdf (1,2,3,4) +***** error cauchy_cdf (ones (3), ones (2), ones (2)) +***** error cauchy_cdf (ones (2), ones (3), ones (2)) +***** error cauchy_cdf (ones (2), ones (2), ones (3)) +***** error cauchy_cdf (i, 2, 2) +***** error cauchy_cdf (2, i, 2) +***** error cauchy_cdf (2, 2, i) +19 tests, 19 passed, 0 known failure, 0 skipped [inst/distributions/wblcdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/wblcdf.m ***** shared x,y @@ -4831,319 +3762,6 @@ ***** error wblcdf (2, i, 2) ***** error wblcdf (2, 2, i) 18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/exppdf.m] ->>>>> /build/octave-statistics-1.4.0/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/logncdf.m] ->>>>> /build/octave-statistics-1.4.0/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.0/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/chi2pdf.m] ->>>>> /build/octave-statistics-1.4.0/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/wblrnd.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/wblrnd.m -***** assert (size (wblrnd (1,2)), [1, 1]) -***** assert (size (wblrnd (ones (2,1), 2)), [2, 1]) -***** assert (size (wblrnd (ones (2,2), 2)), [2, 2]) -***** assert (size (wblrnd (1, 2*ones (2,1))), [2, 1]) -***** assert (size (wblrnd (1, 2*ones (2,2))), [2, 2]) -***** assert (size (wblrnd (1, 2, 3)), [3, 3]) -***** assert (size (wblrnd (1, 2, [4 1])), [4, 1]) -***** assert (size (wblrnd (1, 2, 4, 1)), [4, 1]) -***** assert (class (wblrnd (1, 2)), "double") -***** assert (class (wblrnd (single (1), 2)), "single") -***** assert (class (wblrnd (single ([1 1]), 2)), "single") -***** assert (class (wblrnd (1, single (2))), "single") -***** assert (class (wblrnd (1, single ([2 2]))), "single") -***** error wblrnd () -***** error wblrnd (1) -***** error wblrnd (ones (3), ones (2)) -***** error wblrnd (ones (2), ones (3)) -***** error wblrnd (i, 2) -***** error wblrnd (2, i) -***** error wblrnd (1,2, -1) -***** error wblrnd (1,2, ones (2)) -***** error wblrnd (1, 2, [2 -1 2]) -***** error wblrnd (1,2, 1, ones (2)) -***** error wblrnd (1,2, 1, -1) -***** error wblrnd (ones (2,2), 2, 3) -***** 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/logistic_rnd.m] ->>>>> /build/octave-statistics-1.4.0/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/fcdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/fcdf.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 -[inst/distributions/poissinv.m] ->>>>> /build/octave-statistics-1.4.0/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/chi2inv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/chi2inv.m -***** shared x - x = [-1 0 0.3934693402873666 1 2]; -***** assert (chi2inv (x, 2*ones (1,5)), [NaN 0 1 Inf NaN], 5*eps) -***** assert (chi2inv (x, 2), [NaN 0 1 Inf NaN], 5*eps) -***** assert (chi2inv (x, 2*[0 1 NaN 1 1]), [NaN 0 NaN Inf NaN], 5*eps) -***** assert (chi2inv ([x(1:2) NaN x(4:5)], 2), [NaN 0 NaN Inf NaN], 5*eps) -***** assert (chi2inv ([x, NaN], 2), [NaN 0 1 Inf NaN NaN], 5*eps) -***** assert (chi2inv (single ([x, NaN]), 2), single ([NaN 0 1 Inf NaN NaN]), 5*eps ("single")) -***** assert (chi2inv ([x, NaN], single (2)), single ([NaN 0 1 Inf NaN NaN]), 5*eps ("single")) -***** error chi2inv () -***** error chi2inv (1) -***** error chi2inv (1,2,3) -***** error chi2inv (ones (3), ones (2)) -***** error chi2inv (ones (2), ones (3)) -***** error chi2inv (i, 2) -***** error chi2inv (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/unifcdf.m] ->>>>> /build/octave-statistics-1.4.0/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/unifrnd.m] ->>>>> /build/octave-statistics-1.4.0/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) -27 tests, 27 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_inv.m] ->>>>> /build/octave-statistics-1.4.0/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/betainv.m] ->>>>> /build/octave-statistics-1.4.0/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/logninv.m] ->>>>> /build/octave-statistics-1.4.0/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/nbinpdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/nbinpdf.m ***** shared x,y @@ -5169,73 +3787,6 @@ ***** error nbinpdf (2, i, 2) ***** error nbinpdf (2, 2, i) 19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/cauchy_cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_cdf.m -***** shared x,y - x = [-1 0 0.5 1 2]; - y = 1/pi * atan ((x-1) / 2) + 1/2; -***** assert (cauchy_cdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (cauchy_cdf (x, 1, 2*ones (1,5)), y) -***** assert (cauchy_cdf (x, ones (1,5), 2), y) -***** assert (cauchy_cdf (x, [-Inf 1 NaN 1 Inf], 2), [NaN y(2) NaN y(4) NaN]) -***** assert (cauchy_cdf (x, 1, 2*[0 1 NaN 1 Inf]), [NaN y(2) NaN y(4) NaN]) -***** assert (cauchy_cdf ([x(1:2) NaN x(4:5)], 1, 2), [y(1:2) NaN y(4:5)]) -***** assert (cauchy_cdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (cauchy_cdf (single ([x, NaN]), 1, 2), single ([y, NaN]), eps ("single")) -***** assert (cauchy_cdf ([x, NaN], single (1), 2), single ([y, NaN]), eps ("single")) -***** assert (cauchy_cdf ([x, NaN], 1, single (2)), single ([y, NaN]), eps ("single")) -***** error cauchy_cdf () -***** error cauchy_cdf (1,2) -***** error cauchy_cdf (1,2,3,4) -***** error cauchy_cdf (ones (3), ones (2), ones (2)) -***** error cauchy_cdf (ones (2), ones (3), ones (2)) -***** error cauchy_cdf (ones (2), ones (2), ones (3)) -***** error cauchy_cdf (i, 2, 2) -***** error cauchy_cdf (2, i, 2) -***** error cauchy_cdf (2, 2, i) -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/wblinv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/wblinv.m -***** shared x - x = [-1 0 0.63212055882855778 1 2]; -***** assert (wblinv (x, ones (1,5), ones (1,5)), [NaN 0 1 Inf NaN], eps) -***** assert (wblinv (x, 1, ones (1,5)), [NaN 0 1 Inf NaN], eps) -***** assert (wblinv (x, ones (1,5), 1), [NaN 0 1 Inf NaN], eps) -***** assert (wblinv (x, [1 -1 NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) -***** assert (wblinv (x, 1, [1 -1 NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (wblinv ([x(1:2) NaN x(4:5)], 1, 1), [NaN 0 NaN Inf NaN]) -***** assert (wblinv ([x, NaN], 1, 1), [NaN 0 1 Inf NaN NaN], eps) -***** assert (wblinv (single ([x, NaN]), 1, 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** assert (wblinv ([x, NaN], single (1), 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** assert (wblinv ([x, NaN], 1, single (1)), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) -***** error wblinv () -***** error wblinv (1,2,3,4) -***** error wblinv (ones (3), ones (2), ones (2)) -***** error wblinv (ones (2), ones (3), ones (2)) -***** error wblinv (ones (2), ones (2), ones (3)) -***** error wblinv (i, 2, 2) -***** error wblinv (2, i, 2) -***** error wblinv (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/poisspdf.m] ->>>>> /build/octave-statistics-1.4.0/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/kolmogorov_smirnov_cdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/kolmogorov_smirnov_cdf.m ***** error kolmogorov_smirnov_cdf () @@ -5243,158 +3794,114 @@ ***** 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.0/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) +[inst/distributions/unifcdf.m] +>>>>> /build/octave-statistics-1.4.0/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/unidinv.m] ->>>>> /build/octave-statistics-1.4.0/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/hygernd.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/hygernd.m -***** assert (size (hygernd (4,2,2)), [1, 1]) -***** assert (size (hygernd (4*ones (2,1), 2,2)), [2, 1]) -***** assert (size (hygernd (4*ones (2,2), 2,2)), [2, 2]) -***** assert (size (hygernd (4, 2*ones (2,1), 2)), [2, 1]) -***** assert (size (hygernd (4, 2*ones (2,2), 2)), [2, 2]) -***** assert (size (hygernd (4, 2, 2*ones (2,1))), [2, 1]) -***** assert (size (hygernd (4, 2, 2*ones (2,2))), [2, 2]) -***** assert (size (hygernd (4, 2, 2, 3)), [3, 3]) -***** assert (size (hygernd (4, 2, 2, [4 1])), [4, 1]) -***** assert (size (hygernd (4, 2, 2, 4, 1)), [4, 1]) -***** assert (class (hygernd (4,2,2)), "double") -***** assert (class (hygernd (single (4),2,2)), "single") -***** assert (class (hygernd (single ([4 4]),2,2)), "single") -***** assert (class (hygernd (4,single (2),2)), "single") -***** assert (class (hygernd (4,single ([2 2]),2)), "single") -***** assert (class (hygernd (4,2,single (2))), "single") -***** assert (class (hygernd (4,2,single ([2 2]))), "single") -***** error hygernd () -***** error hygernd (1) -***** error hygernd (1,2) -***** error hygernd (ones (3), ones (2), ones (2), 2) -***** error hygernd (ones (2), ones (3), ones (2), 2) -***** error hygernd (ones (2), ones (2), ones (3), 2) -***** error hygernd (i, 2, 2) -***** error hygernd (2, i, 2) -***** error hygernd (2, 2, i) -***** error hygernd (4,2,2, -1) -***** error hygernd (4,2,2, ones (2)) -***** error hygernd (4,2,2, [2 -1 2]) -***** error hygernd (4*ones (2),2,2, 3) -***** 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/nbininv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/nbininv.m -***** shared x - x = [-1 0 3/4 1 2]; -***** assert (nbininv (x, ones (1,5), 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (nbininv (x, 1, 0.5*ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (nbininv (x, ones (1,5), 0.5), [NaN 0 1 Inf NaN]) -***** assert (nbininv (x, [1 0 NaN Inf 1], 0.5), [NaN NaN NaN NaN NaN]) -***** assert (nbininv (x, [1 0 1.5 Inf 1], 0.5), [NaN NaN 2 NaN NaN]) -***** assert (nbininv (x, 1, 0.5*[1 -Inf NaN Inf 1]), [NaN NaN NaN NaN NaN]) -***** assert (nbininv ([x(1:2) NaN x(4:5)], 1, 0.5), [NaN 0 NaN Inf NaN]) -***** assert (nbininv ([x, NaN], 1, 0.5), [NaN 0 1 Inf NaN NaN]) -***** assert (nbininv (single ([x, NaN]), 1, 0.5), single ([NaN 0 1 Inf NaN NaN])) -***** assert (nbininv ([x, NaN], single (1), 0.5), single ([NaN 0 1 Inf NaN NaN])) -***** assert (nbininv ([x, NaN], 1, single (0.5)), single ([NaN 0 1 Inf NaN NaN])) -***** shared y, tol - y = magic (3) + 1; - tol = 1; -***** assert (nbininv (nbincdf (1:10, 3, 0.1), 3, 0.1), 1:10, tol) -***** assert (nbininv (nbincdf (1:10, 3./(1:10), 0.1), 3./(1:10), 0.1), 1:10, tol) -***** assert (nbininv (nbincdf (y, 3./y, 1./y), 3./y, 1./y), y, tol) -***** error nbininv () -***** error nbininv (1) -***** error nbininv (1,2) -***** error nbininv (1,2,3,4) -***** error nbininv (ones (3), ones (2), ones (2)) -***** error nbininv (ones (2), ones (3), ones (2)) -***** error nbininv (ones (2), ones (2), ones (3)) -***** error nbininv (i, 2, 2) -***** error nbininv (2, i, 2) -***** error nbininv (2, 2, i) -24 tests, 24 passed, 0 known failure, 0 skipped -[inst/distributions/normcdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/normcdf.m +[inst/distributions/logistic_rnd.m] +>>>>> /build/octave-statistics-1.4.0/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/chi2pdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/chi2pdf.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) + 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/trnd.m] +>>>>> /build/octave-statistics-1.4.0/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/expinv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/expinv.m -***** shared x - x = [-1 0 0.3934693402873666 1 2]; -***** assert (expinv (x, 2*ones (1,5)), [NaN 0 1 Inf NaN], eps) -***** assert (expinv (x, 2), [NaN 0 1 Inf NaN], eps) -***** assert (expinv (x, 2*[1 0 NaN 1 1]), [NaN NaN NaN Inf NaN], eps) -***** assert (expinv ([x(1:2) NaN x(4:5)], 2), [NaN 0 NaN Inf NaN], eps) -***** assert (expinv ([x, NaN], 2), [NaN 0 1 Inf NaN NaN], eps) -***** assert (expinv (single ([x, NaN]), 2), single ([NaN 0 1 Inf NaN NaN]), eps) -***** assert (expinv ([x, NaN], single (2)), single ([NaN 0 1 Inf NaN NaN]), eps) -***** error expinv () -***** error expinv (1) -***** error expinv (1,2,3) -***** error expinv (ones (3), ones (2)) -***** error expinv (ones (2), ones (3)) -***** error expinv (i, 2) -***** error expinv (2, i) -14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/laplace_pdf.m] +>>>>> /build/octave-statistics-1.4.0/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/geopdf.m] +>>>>> /build/octave-statistics-1.4.0/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/unidcdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/unidcdf.m ***** shared x,y @@ -5415,6 +3922,74 @@ ***** error unidcdf (i, 2) ***** error unidcdf (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/expinv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/expinv.m +***** shared x + x = [-1 0 0.3934693402873666 1 2]; +***** assert (expinv (x, 2*ones (1,5)), [NaN 0 1 Inf NaN], eps) +***** assert (expinv (x, 2), [NaN 0 1 Inf NaN], eps) +***** assert (expinv (x, 2*[1 0 NaN 1 1]), [NaN NaN NaN Inf NaN], eps) +***** assert (expinv ([x(1:2) NaN x(4:5)], 2), [NaN 0 NaN Inf NaN], eps) +***** assert (expinv ([x, NaN], 2), [NaN 0 1 Inf NaN NaN], eps) +***** assert (expinv (single ([x, NaN]), 2), single ([NaN 0 1 Inf NaN NaN]), eps) +***** assert (expinv ([x, NaN], single (2)), single ([NaN 0 1 Inf NaN NaN]), eps) +***** error expinv () +***** error expinv (1) +***** error expinv (1,2,3) +***** error expinv (ones (3), ones (2)) +***** error expinv (ones (2), ones (3)) +***** error expinv (i, 2) +***** error expinv (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/unidinv.m] +>>>>> /build/octave-statistics-1.4.0/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/wblrnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/wblrnd.m +***** assert (size (wblrnd (1,2)), [1, 1]) +***** assert (size (wblrnd (ones (2,1), 2)), [2, 1]) +***** assert (size (wblrnd (ones (2,2), 2)), [2, 2]) +***** assert (size (wblrnd (1, 2*ones (2,1))), [2, 1]) +***** assert (size (wblrnd (1, 2*ones (2,2))), [2, 2]) +***** assert (size (wblrnd (1, 2, 3)), [3, 3]) +***** assert (size (wblrnd (1, 2, [4 1])), [4, 1]) +***** assert (size (wblrnd (1, 2, 4, 1)), [4, 1]) +***** assert (class (wblrnd (1, 2)), "double") +***** assert (class (wblrnd (single (1), 2)), "single") +***** assert (class (wblrnd (single ([1 1]), 2)), "single") +***** assert (class (wblrnd (1, single (2))), "single") +***** assert (class (wblrnd (1, single ([2 2]))), "single") +***** error wblrnd () +***** error wblrnd (1) +***** error wblrnd (ones (3), ones (2)) +***** error wblrnd (ones (2), ones (3)) +***** error wblrnd (i, 2) +***** error wblrnd (2, i) +***** error wblrnd (1,2, -1) +***** error wblrnd (1,2, ones (2)) +***** error wblrnd (1, 2, [2 -1 2]) +***** error wblrnd (1,2, 1, ones (2)) +***** error wblrnd (1,2, 1, -1) +***** error wblrnd (ones (2,2), 2, 3) +***** 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/binopdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/binopdf.m ***** shared x,y,tol @@ -5478,54 +4053,49 @@ ***** 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/cauchy_inv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_inv.m +[inst/distributions/hygecdf.m] +>>>>> /build/octave-statistics-1.4.0/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/stdnormal_inv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/stdnormal_inv.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/gamcdf.m] ->>>>> /build/octave-statistics-1.4.0/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 +***** 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/unifinv.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/unifinv.m ***** shared x @@ -5550,293 +4120,243 @@ ***** error unifinv (2, i, 2) ***** error unifinv (2, 2, i) 19 tests, 19 passed, 0 known failure, 0 skipped -[inst/distributions/chi2cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/chi2cdf.m +[inst/distributions/wblpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/wblpdf.m +***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = [0, exp(-x(2:4)), NaN]; +***** assert (wblpdf (x, ones (1,5), ones (1,5)), y) +***** assert (wblpdf (x, 1, ones (1,5)), y) +***** assert (wblpdf (x, ones (1,5), 1), y) +***** assert (wblpdf (x, [0 NaN Inf 1 1], 1), [NaN NaN NaN y(4:5)]) +***** assert (wblpdf (x, 1, [0 NaN Inf 1 1]), [NaN NaN NaN y(4:5)]) +***** assert (wblpdf ([x, NaN], 1, 1), [y, NaN]) +***** assert (wblpdf (single ([x, NaN]), 1, 1), single ([y, NaN])) +***** assert (wblpdf ([x, NaN], single (1), 1), single ([y, NaN])) +***** assert (wblpdf ([x, NaN], 1, single (1)), single ([y, NaN])) +***** error wblpdf () +***** error wblpdf (1,2,3,4) +***** error wblpdf (ones (3), ones (2), ones (2)) +***** error wblpdf (ones (2), ones (3), ones (2)) +***** error wblpdf (ones (2), ones (2), ones (3)) +***** error wblpdf (i, 2, 2) +***** error wblpdf (2, i, 2) +***** error wblpdf (2, 2, i) +17 tests, 17 passed, 0 known failure, 0 skipped +[inst/distributions/fpdf.m] +>>>>> /build/octave-statistics-1.4.0/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, 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/finv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/finv.m -***** shared x - x = [-1 0 0.5 1 2]; -***** assert (finv (x, 2*ones (1,5), 2*ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (finv (x, 2, 2*ones (1,5)), [NaN 0 1 Inf NaN]) -***** assert (finv (x, 2*ones (1,5), 2), [NaN 0 1 Inf NaN]) -***** assert (finv (x, [2 -Inf NaN Inf 2], 2), [NaN NaN NaN NaN NaN]) -***** assert (finv (x, 2, [2 -Inf NaN Inf 2]), [NaN NaN NaN NaN NaN]) -***** assert (finv ([x(1:2) NaN x(4:5)], 2, 2), [NaN 0 NaN Inf NaN]) -***** assert (finv ([x, NaN], 2, 2), [NaN 0 1 Inf NaN NaN]) -***** assert (finv (single ([x, NaN]), 2, 2), single ([NaN 0 1 Inf NaN NaN])) -***** assert (finv ([x, NaN], single (2), 2), single ([NaN 0 1 Inf NaN NaN])) -***** assert (finv ([x, NaN], 2, single (2)), single ([NaN 0 1 Inf NaN NaN])) -***** error finv () -***** error finv (1) -***** error finv (1,2) -***** error finv (1,2,3,4) -***** error finv (ones (3), ones (2), ones (2)) -***** error finv (ones (2), ones (3), ones (2)) -***** error finv (ones (2), ones (2), ones (3)) -***** error finv (i, 2, 2) -***** error finv (2, i, 2) -***** error finv (2, 2, i) + 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/stdnormal_rnd.m] ->>>>> /build/octave-statistics-1.4.0/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/unifpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/unifpdf.m -***** shared x,y - x = [-1 0 0.5 1 2] + 1; - y = [0 1 1 1 0]; -***** assert (unifpdf (x, ones (1,5), 2*ones (1,5)), y) -***** assert (unifpdf (x, 1, 2*ones (1,5)), y) -***** assert (unifpdf (x, ones (1,5), 2), y) -***** assert (unifpdf (x, [2 NaN 1 1 1], 2), [NaN NaN y(3:5)]) -***** assert (unifpdf (x, 1, 2*[0 NaN 1 1 1]), [NaN NaN y(3:5)]) -***** assert (unifpdf ([x, NaN], 1, 2), [y, NaN]) -***** assert (unifpdf (single ([x, NaN]), 1, 2), single ([y, NaN])) -***** assert (unifpdf (single ([x, NaN]), single (1), 2), single ([y, NaN])) -***** assert (unifpdf ([x, NaN], 1, single (2)), single ([y, NaN])) -***** error unifpdf () -***** error unifpdf (1,2) -***** error unifpdf (1,2,3,4) -***** error unifpdf (ones (3), ones (2), ones (2)) -***** error unifpdf (ones (2), ones (3), ones (2)) -***** error unifpdf (ones (2), ones (2), ones (3)) -***** error unifpdf (i, 2, 2) -***** error unifpdf (2, i, 2) -***** error unifpdf (2, 2, i) -18 tests, 18 passed, 0 known failure, 0 skipped -[inst/distributions/expcdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/expcdf.m -***** shared x,y - x = [-1 0 0.5 1 Inf]; - y = [0, 1 - exp(-x(2:end)/2)]; -***** assert (expcdf (x, 2*ones (1,5)), y) -***** assert (expcdf (x, 2), y) -***** assert (expcdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) -***** assert (expcdf ([x, NaN], 2), [y, NaN]) -***** assert (expcdf (single ([x, NaN]), 2), single ([y, NaN])) -***** assert (expcdf ([x, NaN], single (2)), single ([y, NaN])) -***** error expcdf () -***** error expcdf (1) -***** error expcdf (1,2,3) -***** error expcdf (ones (3), ones (2)) -***** error expcdf (ones (2), ones (3)) -***** error expcdf (i, 2) -***** error expcdf (2, i) +[inst/distributions/unidrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/exprnd.m] ->>>>> /build/octave-statistics-1.4.0/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/gampdf.m] ->>>>> /build/octave-statistics-1.4.0/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/nbincdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/nbincdf.m +[inst/distributions/logistic_pdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/logistic_pdf.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/norminv.m] ->>>>> /build/octave-statistics-1.4.0/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/cauchy_pdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_pdf.m + 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/logncdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/logncdf.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) + 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/geocdf.m] ->>>>> /build/octave-statistics-1.4.0/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/unidpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/unidpdf.m +[inst/distributions/poisspdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/poisspdf.m ***** shared x,y - x = [-1 0 1 2 10 11]; - y = [0 0 0.1 0.1 0.1 0]; -***** assert (unidpdf (x, 10*ones (1,6)), y) -***** assert (unidpdf (x, 10), y) -***** assert (unidpdf (x, 10*[0 NaN 1 1 1 1]), [NaN NaN y(3:6)]) -***** assert (unidpdf ([x, NaN], 10), [y, NaN]) -***** assert (unidpdf (single ([x, NaN]), 10), single ([y, NaN])) -***** assert (unidpdf ([x, NaN], single (10)), single ([y, NaN])) -***** error unidpdf () -***** error unidpdf (1) -***** error unidpdf (1,2,3) -***** error unidpdf (ones (3), ones (2)) -***** error unidpdf (ones (2), ones (3)) -***** error unidpdf (i, 2) -***** error unidpdf (2, i) + 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/lognpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/lognpdf.m +[inst/distributions/gamcdf.m] +>>>>> /build/octave-statistics-1.4.0/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/laplace_rnd.m] +>>>>> /build/octave-statistics-1.4.0/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/betacdf.m] +>>>>> /build/octave-statistics-1.4.0/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/cauchy_inv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_inv.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/nbinrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/binornd.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/binornd.m ***** assert (binornd (0, 0, 1), 0) @@ -5869,28 +4389,107 @@ ***** 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/laplace_cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/laplace_cdf.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/logistic_cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/logistic_cdf.m +[inst/distributions/wblinv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/wblinv.m +***** shared x + x = [-1 0 0.63212055882855778 1 2]; +***** assert (wblinv (x, ones (1,5), ones (1,5)), [NaN 0 1 Inf NaN], eps) +***** assert (wblinv (x, 1, ones (1,5)), [NaN 0 1 Inf NaN], eps) +***** assert (wblinv (x, ones (1,5), 1), [NaN 0 1 Inf NaN], eps) +***** assert (wblinv (x, [1 -1 NaN Inf 1], 1), [NaN NaN NaN NaN NaN]) +***** assert (wblinv (x, 1, [1 -1 NaN Inf 1]), [NaN NaN NaN NaN NaN]) +***** assert (wblinv ([x(1:2) NaN x(4:5)], 1, 1), [NaN 0 NaN Inf NaN]) +***** assert (wblinv ([x, NaN], 1, 1), [NaN 0 1 Inf NaN NaN], eps) +***** assert (wblinv (single ([x, NaN]), 1, 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** assert (wblinv ([x, NaN], single (1), 1), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** assert (wblinv ([x, NaN], 1, single (1)), single ([NaN 0 1 Inf NaN NaN]), eps ("single")) +***** error wblinv () +***** error wblinv (1,2,3,4) +***** error wblinv (ones (3), ones (2), ones (2)) +***** error wblinv (ones (2), ones (3), ones (2)) +***** error wblinv (ones (2), ones (2), ones (3)) +***** error wblinv (i, 2, 2) +***** error wblinv (2, i, 2) +***** error wblinv (2, 2, i) +18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/chi2rnd.m] +>>>>> /build/octave-statistics-1.4.0/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/nbincdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/nbincdf.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 + 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/betarnd.m] +>>>>> /build/octave-statistics-1.4.0/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/gaminv.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/gaminv.m ***** shared x @@ -5916,92 +4515,6 @@ ***** error gaminv (2, i, 2) ***** error gaminv (2, 2, i) 20 tests, 20 passed, 0 known failure, 0 skipped -[inst/distributions/poissrnd.m] ->>>>> /build/octave-statistics-1.4.0/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/hygecdf.m] ->>>>> /build/octave-statistics-1.4.0/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/fpdf.m] ->>>>> /build/octave-statistics-1.4.0/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/stdnormal_pdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/stdnormal_pdf.m ***** shared x,y @@ -6013,126 +4526,119 @@ ***** error stdnormal_pdf (1,2) ***** error stdnormal_pdf (i) 5 tests, 5 passed, 0 known failure, 0 skipped -[inst/distributions/laplace_pdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/laplace_pdf.m +[inst/distributions/tpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/tpdf.m +***** test + x = rand (10,1); + y = 1./(pi * (1 + x.^2)); + assert (tpdf (x, 1), y, 5*eps); +***** shared x,y + x = [-Inf 0 0.5 1 Inf]; + y = 1./(pi * (1 + x.^2)); +***** assert (tpdf (x, ones (1,5)), y, eps) +***** assert (tpdf (x, 1), y, eps) +***** assert (tpdf (x, [0 NaN 1 1 1]), [NaN NaN y(3:5)], eps) +***** assert (tpdf ([x, NaN], 1), [y, NaN], eps) +***** assert (tpdf (single ([x, NaN]), 1), single ([y, NaN]), eps ("single")) +***** assert (tpdf ([x, NaN], single (1)), single ([y, NaN]), eps ("single")) +***** error tpdf () +***** error tpdf (1) +***** error tpdf (1,2,3) +***** error tpdf (ones (3), ones (2)) +***** error tpdf (ones (2), ones (3)) +***** error tpdf (i, 2) +***** error tpdf (2, i) +14 tests, 14 passed, 0 known failure, 0 skipped +[inst/distributions/normpdf.m] +>>>>> /build/octave-statistics-1.4.0/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) +***** assert (normpdf (x, 1, ones (1,4)), y) +***** assert (normpdf (x, ones (1,4), 1), y) +***** assert (normpdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN]) +***** assert (normpdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN]) +***** assert (normpdf ([x, NaN], 1, 1), [y, NaN]) +***** 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/laplace_inv.m] +>>>>> /build/octave-statistics-1.4.0/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/geocdf.m] +>>>>> /build/octave-statistics-1.4.0/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/laplace_cdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/laplace_cdf.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) + 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/geopdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/geopdf.m +[inst/distributions/lognpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/lognpdf.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/betarnd.m] ->>>>> /build/octave-statistics-1.4.0/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/frnd.m] ->>>>> /build/octave-statistics-1.4.0/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/gamrnd.m] ->>>>> /build/octave-statistics-1.4.0/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 + 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/normrnd.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/normrnd.m ***** assert (size (normrnd (1,2)), [1, 1]) @@ -6163,119 +4669,65 @@ ***** 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/hygepdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/hygepdf.m +[inst/distributions/cauchy_pdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/cauchy_pdf.m ***** shared x,y - x = [-1 0 1 2 3]; - y = [0 1/6 4/6 1/6 0]; -***** assert (hygepdf (x, 4*ones (1,5), 2, 2), y) -***** assert (hygepdf (x, 4, 2*ones (1,5), 2), y) -***** assert (hygepdf (x, 4, 2, 2*ones (1,5)), y) -***** assert (hygepdf (x, 4*[1 -1 NaN 1.1 1], 2, 2), [0 NaN NaN NaN 0]) -***** assert (hygepdf (x, 4, 2*[1 -1 NaN 1.1 1], 2), [0 NaN NaN NaN 0]) -***** assert (hygepdf (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) -***** assert (hygepdf (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [0 NaN NaN NaN 0]) -***** assert (hygepdf (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) -***** assert (hygepdf ([x, NaN], 4, 2, 2), [y, NaN], eps) -***** assert (hygepdf (single ([x, NaN]), 4, 2, 2), single ([y, NaN])) -***** assert (hygepdf ([x, NaN], single (4), 2, 2), single ([y, NaN])) -***** assert (hygepdf ([x, NaN], 4, single (2), 2), single ([y, NaN])) -***** assert (hygepdf ([x, NaN], 4, 2, single (2)), single ([y, NaN])) -***** error hygepdf () -***** error hygepdf (1) -***** error hygepdf (1,2) -***** error hygepdf (1,2,3) -***** error hygepdf (1,2,3,4,5) -***** error hygepdf (1, ones (3), ones (2), ones (2)) -***** error hygepdf (1, ones (2), ones (3), ones (2)) -***** error hygepdf (1, ones (2), ones (2), ones (3)) -***** error hygepdf (i, 2, 2, 2) -***** error hygepdf (2, i, 2, 2) -***** error hygepdf (2, 2, i, 2) -***** error hygepdf (2, 2, 2, i) -25 tests, 25 passed, 0 known failure, 0 skipped -[inst/distributions/trnd.m] ->>>>> /build/octave-statistics-1.4.0/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) + 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/stdnormal_inv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/stdnormal_inv.m +[inst/distributions/hygeinv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/hygeinv.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/nbinrnd.m] ->>>>> /build/octave-statistics-1.4.0/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) +***** 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/geoinv.m] ->>>>> /build/octave-statistics-1.4.0/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/tcdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/tcdf.m ***** shared x,y @@ -6310,119 +4762,309 @@ ***** 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/unidrnd.m] ->>>>> /build/octave-statistics-1.4.0/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) +[inst/distributions/expcdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/expcdf.m +***** shared x,y + x = [-1 0 0.5 1 Inf]; + y = [0, 1 - exp(-x(2:end)/2)]; +***** assert (expcdf (x, 2*ones (1,5)), y) +***** assert (expcdf (x, 2), y) +***** assert (expcdf (x, 2*[1 0 NaN 1 1]), [y(1) NaN NaN y(4:5)]) +***** assert (expcdf ([x, NaN], 2), [y, NaN]) +***** assert (expcdf (single ([x, NaN]), 2), single ([y, NaN])) +***** assert (expcdf ([x, NaN], single (2)), single ([y, NaN])) +***** error expcdf () +***** error expcdf (1) +***** error expcdf (1,2,3) +***** error expcdf (ones (3), ones (2)) +***** error expcdf (ones (2), ones (3)) +***** error expcdf (i, 2) +***** error expcdf (2, i) 13 tests, 13 passed, 0 known failure, 0 skipped -[inst/distributions/logistic_inv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/logistic_inv.m +[inst/distributions/unifrnd.m] +>>>>> /build/octave-statistics-1.4.0/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) +27 tests, 27 passed, 0 known failure, 0 skipped +[inst/distributions/logninv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/logninv.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/logistic_pdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/logistic_pdf.m +***** 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/finv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/finv.m +***** shared x + x = [-1 0 0.5 1 2]; +***** assert (finv (x, 2*ones (1,5), 2*ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (finv (x, 2, 2*ones (1,5)), [NaN 0 1 Inf NaN]) +***** assert (finv (x, 2*ones (1,5), 2), [NaN 0 1 Inf NaN]) +***** assert (finv (x, [2 -Inf NaN Inf 2], 2), [NaN NaN NaN NaN NaN]) +***** assert (finv (x, 2, [2 -Inf NaN Inf 2]), [NaN NaN NaN NaN NaN]) +***** assert (finv ([x(1:2) NaN x(4:5)], 2, 2), [NaN 0 NaN Inf NaN]) +***** assert (finv ([x, NaN], 2, 2), [NaN 0 1 Inf NaN NaN]) +***** assert (finv (single ([x, NaN]), 2, 2), single ([NaN 0 1 Inf NaN NaN])) +***** assert (finv ([x, NaN], single (2), 2), single ([NaN 0 1 Inf NaN NaN])) +***** assert (finv ([x, NaN], 2, single (2)), single ([NaN 0 1 Inf NaN NaN])) +***** error finv () +***** error finv (1) +***** error finv (1,2) +***** error finv (1,2,3,4) +***** error finv (ones (3), ones (2), ones (2)) +***** error finv (ones (2), ones (3), ones (2)) +***** error finv (ones (2), ones (2), ones (3)) +***** error finv (i, 2, 2) +***** error finv (2, i, 2) +***** error finv (2, 2, i) +20 tests, 20 passed, 0 known failure, 0 skipped +[inst/distributions/gampdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/gampdf.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) + 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/stdnormal_cdf.m] +>>>>> /build/octave-statistics-1.4.0/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/tinv.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/tinv.m +[inst/distributions/poissrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/fcdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/fcdf.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 +[inst/distributions/chi2inv.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/chi2inv.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) + x = [-1 0 0.3934693402873666 1 2]; +***** assert (chi2inv (x, 2*ones (1,5)), [NaN 0 1 Inf NaN], 5*eps) +***** assert (chi2inv (x, 2), [NaN 0 1 Inf NaN], 5*eps) +***** assert (chi2inv (x, 2*[0 1 NaN 1 1]), [NaN 0 NaN Inf NaN], 5*eps) +***** assert (chi2inv ([x(1:2) NaN x(4:5)], 2), [NaN 0 NaN Inf NaN], 5*eps) +***** assert (chi2inv ([x, NaN], 2), [NaN 0 1 Inf NaN NaN], 5*eps) +***** assert (chi2inv (single ([x, NaN]), 2), single ([NaN 0 1 Inf NaN NaN]), 5*eps ("single")) +***** assert (chi2inv ([x, NaN], single (2)), single ([NaN 0 1 Inf NaN NaN]), 5*eps ("single")) +***** error chi2inv () +***** error chi2inv (1) +***** error chi2inv (1,2,3) +***** error chi2inv (ones (3), ones (2)) +***** error chi2inv (ones (2), ones (3)) +***** error chi2inv (i, 2) +***** error chi2inv (2, i) 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/distributions/hygeinv.m] ->>>>> /build/octave-statistics-1.4.0/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/normpdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/normpdf.m +[inst/distributions/unifpdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/unifpdf.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) -***** assert (normpdf (x, 1, ones (1,4)), y) -***** assert (normpdf (x, ones (1,4), 1), y) -***** assert (normpdf (x, [0 -Inf NaN Inf], 1), [y(1) NaN NaN NaN]) -***** assert (normpdf (x, 1, [Inf NaN -1 0]), [NaN NaN NaN NaN]) -***** assert (normpdf ([x, NaN], 1, 1), [y, NaN]) -***** 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) + x = [-1 0 0.5 1 2] + 1; + y = [0 1 1 1 0]; +***** assert (unifpdf (x, ones (1,5), 2*ones (1,5)), y) +***** assert (unifpdf (x, 1, 2*ones (1,5)), y) +***** assert (unifpdf (x, ones (1,5), 2), y) +***** assert (unifpdf (x, [2 NaN 1 1 1], 2), [NaN NaN y(3:5)]) +***** assert (unifpdf (x, 1, 2*[0 NaN 1 1 1]), [NaN NaN y(3:5)]) +***** assert (unifpdf ([x, NaN], 1, 2), [y, NaN]) +***** assert (unifpdf (single ([x, NaN]), 1, 2), single ([y, NaN])) +***** assert (unifpdf (single ([x, NaN]), single (1), 2), single ([y, NaN])) +***** assert (unifpdf ([x, NaN], 1, single (2)), single ([y, NaN])) +***** error unifpdf () +***** error unifpdf (1,2) +***** error unifpdf (1,2,3,4) +***** error unifpdf (ones (3), ones (2), ones (2)) +***** error unifpdf (ones (2), ones (3), ones (2)) +***** error unifpdf (ones (2), ones (2), ones (3)) +***** error unifpdf (i, 2, 2) +***** error unifpdf (2, i, 2) +***** error unifpdf (2, 2, i) 18 tests, 18 passed, 0 known failure, 0 skipped +[inst/distributions/geoinv.m] +>>>>> /build/octave-statistics-1.4.0/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.0/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/hygernd.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/hygernd.m +***** assert (size (hygernd (4,2,2)), [1, 1]) +***** assert (size (hygernd (4*ones (2,1), 2,2)), [2, 1]) +***** assert (size (hygernd (4*ones (2,2), 2,2)), [2, 2]) +***** assert (size (hygernd (4, 2*ones (2,1), 2)), [2, 1]) +***** assert (size (hygernd (4, 2*ones (2,2), 2)), [2, 2]) +***** assert (size (hygernd (4, 2, 2*ones (2,1))), [2, 1]) +***** assert (size (hygernd (4, 2, 2*ones (2,2))), [2, 2]) +***** assert (size (hygernd (4, 2, 2, 3)), [3, 3]) +***** assert (size (hygernd (4, 2, 2, [4 1])), [4, 1]) +***** assert (size (hygernd (4, 2, 2, 4, 1)), [4, 1]) +***** assert (class (hygernd (4,2,2)), "double") +***** assert (class (hygernd (single (4),2,2)), "single") +***** assert (class (hygernd (single ([4 4]),2,2)), "single") +***** assert (class (hygernd (4,single (2),2)), "single") +***** assert (class (hygernd (4,single ([2 2]),2)), "single") +***** assert (class (hygernd (4,2,single (2))), "single") +***** assert (class (hygernd (4,2,single ([2 2]))), "single") +***** error hygernd () +***** error hygernd (1) +***** error hygernd (1,2) +***** error hygernd (ones (3), ones (2), ones (2), 2) +***** error hygernd (ones (2), ones (3), ones (2), 2) +***** error hygernd (ones (2), ones (2), ones (3), 2) +***** error hygernd (i, 2, 2) +***** error hygernd (2, i, 2) +***** error hygernd (2, 2, i) +***** error hygernd (4,2,2, -1) +***** error hygernd (4,2,2, ones (2)) +***** error hygernd (4,2,2, [2 -1 2]) +***** error hygernd (4*ones (2),2,2, 3) +***** 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/binocdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/binocdf.m ***** shared x,y @@ -6449,29 +5091,90 @@ ***** 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.0/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/stdnormal_cdf.m] ->>>>> /build/octave-statistics-1.4.0/inst/distributions/stdnormal_cdf.m +[inst/distributions/logistic_inv.m] +>>>>> /build/octave-statistics-1.4.0/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/betapdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/distributions/betapdf.m ***** shared x,y - x = [-Inf 0 1 Inf]; + 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/normcdf.m] +>>>>> /build/octave-statistics-1.4.0/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 (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 +***** 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/exppdf.m] +>>>>> /build/octave-statistics-1.4.0/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/poisscdf.m] >>>>> /build/octave-statistics-1.4.0/inst/distributions/poisscdf.m ***** shared x,y @@ -6492,6 +5195,988 @@ ***** 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.0/inst/distributions/hygepdf.m +***** shared x,y + x = [-1 0 1 2 3]; + y = [0 1/6 4/6 1/6 0]; +***** assert (hygepdf (x, 4*ones (1,5), 2, 2), y) +***** assert (hygepdf (x, 4, 2*ones (1,5), 2), y) +***** assert (hygepdf (x, 4, 2, 2*ones (1,5)), y) +***** assert (hygepdf (x, 4*[1 -1 NaN 1.1 1], 2, 2), [0 NaN NaN NaN 0]) +***** assert (hygepdf (x, 4, 2*[1 -1 NaN 1.1 1], 2), [0 NaN NaN NaN 0]) +***** assert (hygepdf (x, 4, 5, 2), [NaN NaN NaN NaN NaN]) +***** assert (hygepdf (x, 4, 2, 2*[1 -1 NaN 1.1 1]), [0 NaN NaN NaN 0]) +***** assert (hygepdf (x, 4, 2, 5), [NaN NaN NaN NaN NaN]) +***** assert (hygepdf ([x, NaN], 4, 2, 2), [y, NaN], eps) +***** assert (hygepdf (single ([x, NaN]), 4, 2, 2), single ([y, NaN])) +***** assert (hygepdf ([x, NaN], single (4), 2, 2), single ([y, NaN])) +***** assert (hygepdf ([x, NaN], 4, single (2), 2), single ([y, NaN])) +***** assert (hygepdf ([x, NaN], 4, 2, single (2)), single ([y, NaN])) +***** error hygepdf () +***** error hygepdf (1) +***** error hygepdf (1,2) +***** error hygepdf (1,2,3) +***** error hygepdf (1,2,3,4,5) +***** error hygepdf (1, ones (3), ones (2), ones (2)) +***** error hygepdf (1, ones (2), ones (3), ones (2)) +***** error hygepdf (1, ones (2), ones (2), ones (3)) +***** error hygepdf (i, 2, 2, 2) +***** error hygepdf (2, i, 2, 2) +***** error hygepdf (2, 2, i, 2) +***** error hygepdf (2, 2, 2, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/distributions/lognrnd.m] +>>>>> /build/octave-statistics-1.4.0/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_rnd.m] +>>>>> /build/octave-statistics-1.4.0/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/ttest.m] +>>>>> /build/octave-statistics-1.4.0/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/casewrite.m] +>>>>> /build/octave-statistics-1.4.0/inst/casewrite.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); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/caseread.m] +>>>>> /build/octave-statistics-1.4.0/inst/caseread.m +***** shared n, casereadfile + n = ["a ";"bcd";"ef "]; + casereadfile = file_in_loadpath("test/caseread.dat"); +***** assert (caseread (casereadfile), n); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/hmmestimate.m] +>>>>> /build/octave-statistics-1.4.0/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/unifstat.m] +>>>>> /build/octave-statistics-1.4.0/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/linkage.m] +>>>>> /build/octave-statistics-1.4.0/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 linkage (pdist (x), "median"); +***** test warning off clustering + assert (cond (linkage (pdist (x), "median")), 27.683325,t); + warning on clustering +warning: clustering +***** 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/fstat.m] +>>>>> /build/octave-statistics-1.4.0/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/nakarnd.m] +>>>>> /build/octave-statistics-1.4.0/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/trirnd.m] +>>>>> /build/octave-statistics-1.4.0/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/burrpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/jackknife.m] +>>>>> /build/octave-statistics-1.4.0/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/mvnpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/gevfit_lmom.m] +>>>>> /build/octave-statistics-1.4.0/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/crossval.m] +>>>>> /build/octave-statistics-1.4.0/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.0/debian/octave-statistics/usr/share/octave/packages/statistics-1.4.0/fisheriris.txt' found by searching load path +1 test, 1 passed, 0 known failure, 0 skipped +[inst/combnk.m] +>>>>> /build/octave-statistics-1.4.0/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/cmdscale.m] +>>>>> /build/octave-statistics-1.4.0/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/regress.m] +>>>>> /build/octave-statistics-1.4.0/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 +1 test, 1 passed, 0 known failure, 0 skipped +[inst/gevinv.m] +>>>>> /build/octave-statistics-1.4.0/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/unidstat.m] +>>>>> /build/octave-statistics-1.4.0/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/mvtpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/nansum.m] +>>>>> /build/octave-statistics-1.4.0/inst/nansum.m +***** assert (nansum ([2 4 NaN 7]), 13) +***** assert (nansum ([2 4 NaN Inf]), Inf) +***** assert (nansum ([1 NaN 3; NaN 5 6; 7 8 NaN]), [8 13 9]) +***** assert (nansum ([1 NaN 3; NaN 5 6; 7 8 NaN], 2), [4; 11; 15]) +***** assert (nansum (single ([1 NaN 3; NaN 5 6; 7 8 NaN])), single ([8 13 9])) +***** assert (nansum (single ([1 NaN 3; NaN 5 6; 7 8 NaN]), "double"), [8 13 9]) +***** assert (nansum (uint8 ([2 4 1 7])), 14) +***** 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/wblstat.m] +>>>>> /build/octave-statistics-1.4.0/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/triinv.m] +>>>>> /build/octave-statistics-1.4.0/inst/triinv.m +***** shared x,y + x = [-1, 0, 0.02, 0.5, 0.98, 1, 2]; + y = [NaN, 0, 0.1, 0.5, 0.9, 1, NaN] + 1; +***** assert (triinv (x, ones (1,7), 2*ones (1,7), 1.5*ones (1,7)), y, eps) +***** assert (triinv (x, 1*ones (1,7), 2, 1.5), y, eps) +***** assert (triinv (x, 1, 2*ones (1,7), 1.5), y, eps) +***** assert (triinv (x, 1, 2, 1.5*ones (1,7)), y, eps) +***** assert (triinv (x, 1, 2, 1.5), y, eps) +***** assert (triinv (x, [1, 1, NaN, 1, 1, 1, 1], 2, 1.5), [y(1:2), NaN, y(4:7)], eps) +***** assert (triinv (x, 1, 2*[1, 1, NaN, 1, 1, 1, 1], 1.5), [y(1:2), NaN, y(4:7)], eps) +***** assert (triinv (x, 1, 2, 1.5*[1, 1, NaN, 1, 1, 1, 1]), [y(1:2), NaN, y(4:7)], eps) +***** assert (triinv ([x, NaN], 1, 2, 1.5), [y, NaN], eps) +***** assert (triinv (single ([x, NaN]), 1, 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (triinv ([x, NaN], single (1), 2, 1.5), single ([y, NaN]), eps('single')) +***** assert (triinv ([x, NaN], 1, single (2), 1.5), single ([y, NaN]), eps('single')) +***** assert (triinv ([x, NaN], 1, 2, single (1.5)), single ([y, NaN]), eps('single')) +***** error triinv () +***** error triinv (1) +***** error triinv (1,2) +***** error triinv (1,2,3) +***** error triinv (1,2,3,4,5) +***** error triinv (1, ones (3), ones (2), ones (2)) +***** error triinv (1, ones (2), ones (3), ones (2)) +***** error triinv (1, ones (2), ones (2), ones (3)) +***** error triinv (i, 2, 2, 2) +***** error triinv (2, i, 2, 2) +***** error triinv (2, 2, i, 2) +***** error triinv (2, 2, 2, i) +25 tests, 25 passed, 0 known failure, 0 skipped +[inst/grp2idx.m] +>>>>> /build/octave-statistics-1.4.0/inst/grp2idx.m +***** test + in = [true false false true]; + out = {[2; 1; 1; 2] {"0"; "1"} [false; true]}; + assert (nthargout (1:3, @grp2idx, in), out) + assert (nthargout (1:3, @grp2idx, in), nthargout (1:3, @grp2idx, in')) +***** test + assert (nthargout (1:3, @grp2idx, [false true]), + {[1; 2] {"0"; "1"} [false; true]}); + assert (nthargout (1:3, @grp2idx, [true false]), + {[2; 1] {"0"; "1"} [false; true]}); +***** assert (nthargout (1:3, @grp2idx, ["oct"; "sci"; "oct"; "oct"; "sci"]), + {[1; 2; 1; 1; 2] {"oct"; "sci"} ["oct"; "sci"]}); +***** assert (nthargout (1:3, @grp2idx, {"oct"; "sci"; "oct"; "oct"; "sci"}), + {[1; 2; 1; 1; 2] {"oct"; "sci"} {"oct"; "sci"}}); +***** assert (nthargout (1:3, @grp2idx, [ 1 -3 -2 -3 -3 2 1 -1 3 -3]), + {[4; 1; 2; 1; 1; 5; 4; 3; 6; 1] {"-3"; "-2"; "-1"; "1"; "2"; "3"} ... + [-3; -2; -1; 1; 2; 3]}); +***** assert (nthargout (1:3, @grp2idx, [2 2 3 NaN 2 3]), + {[1; 1; 2; NaN; 1; 2] {"2"; "3"} [2; 3]}) +***** assert (nthargout (1:3, @grp2idx, {"et" "sa" "sa" "" "et"}), + {[1; 2; 2; NaN; 1] {"et"; "sa"} {"et"; "sa"}}) +***** xtest <51928> assert (nthargout (1:3, @grp2idx, ["sci"; "oct"; "sci"; "oct"; "oct"]), + {[1; 2; 1; 2; 2] {"sci"; "oct"} ["sci"; "oct"]}); +!!!!! known bug: https://octave.org/testfailure/?51928 +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + (1) 2 1 Abs err 1 exceeds tol 0 by 1 + (2) 1 2 Abs err 1 exceeds tol 0 by 1 + (3) 2 1 Abs err 1 exceeds tol 0 by 1 + (4) 1 2 Abs err 1 exceeds tol 0 by 1 + (5) 1 2 Abs err 1 exceeds tol 0 by 1 + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] oct sci Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] sci oct Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] osccti soccit Strings don't match +***** xtest <51928> assert (nthargout (1:3, @grp2idx, {"sci"; "oct"; "sci"; "oct"; "oct"}), + {[1; 2; 1; 2; 2] {"sci"; "oct"} {"sci"; "oct"}}); +!!!!! known bug: https://octave.org/testfailure/?51928 +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + (1) 2 1 Abs err 1 exceeds tol 0 by 1 + (2) 1 2 Abs err 1 exceeds tol 0 by 1 + (3) 2 1 Abs err 1 exceeds tol 0 by 1 + (4) 1 2 Abs err 1 exceeds tol 0 by 1 + (5) 1 2 Abs err 1 exceeds tol 0 by 1 + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] oct sci Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] sci oct Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] oct sci Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] sci oct Strings don't match +***** xtest <51928> assert (nthargout (1:3, @grp2idx, {"sa" "et" "et" "" "sa"}), + {[1; 2; 2; NaN; 1] {"sa"; "et"} {"sa"; "et"}}) +!!!!! known bug: https://octave.org/testfailure/?51928 +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + (1) 2 1 Abs err 1 exceeds tol 0 by 1 + (2) 1 2 Abs err 1 exceeds tol 0 by 1 + (3) 1 2 Abs err 1 exceeds tol 0 by 1 + (5) 2 1 Abs err 1 exceeds tol 0 by 1 + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] et sa Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] sa et Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] et sa Strings don't match + +ASSERT errors for: assert (cond {i},expected {i},tol) + + Location | Observed | Expected | Reason + [] sa et Strings don't match +10 tests, 7 passed, 0 known failure, 3 skipped +[inst/tblwrite.m] +>>>>> /build/octave-statistics-1.4.0/inst/tblwrite.m +***** shared privpath + privpath = [fileparts(which('tblwrite')) filesep() 'private']; +***** test + addpath (privpath,'-end') + [d err] = tbl_delim (" "); + assert (d, " "); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("space"); + assert (d, " "); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("tab"); + assert (d, sprintf ("\t")); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("comma"); + assert (d, ","); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("semi"); + assert (d, ";"); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("bar"); + assert (d, "|"); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("x"); + assert (d, "x"); + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ('\r'); + assert (d, sprintf ('\r')) + assert (err, ""); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ("bars"); + assert (isnan (d)); + assert (! isempty (err)); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim (""); + assert (isnan (d)); + assert (! isempty (err)); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim (5); + assert (isnan (d)); + assert (! isempty (err)); + rmpath (privpath); +***** test + addpath (privpath,'-end') + [d err] = tbl_delim ({"."}); + assert (isnan (d)); + assert (! isempty (err)); + rmpath (privpath); +***** shared d, v, c, tempfilename + d = [1 2;3 4]; + v = ["a ";"bc"]; + c = ["de";"f "]; + tempfilename = tempname; +***** test + tblwrite (d, v, c, tempfilename); + [dt vt ct] = tblread (tempfilename, " "); + assert (dt, d); + assert (vt, v); + assert (ct, c); + delete (tempfilename); +***** test + tblwrite (d, v, c, tempfilename, " "); + [dt vt ct] = tblread (tempfilename, " "); + assert (dt, d); + assert (vt, v); + assert (ct, c); + delete (tempfilename); +***** test + tblwrite (d, v, c, tempfilename, "space"); + [dt vt ct] = tblread (tempfilename); + assert (dt, d); + assert (vt, v); + assert (ct, c); + delete (tempfilename); +***** test + tblwrite (d, v, c, tempfilename, "tab"); + [dt vt ct] = tblread (tempfilename, "tab"); + assert (dt, d); + assert (vt, v); + assert (ct, c); + delete (tempfilename); +***** test + tblwrite (d, v, c, tempfilename, "\t"); + [dt vt ct] = tblread (tempfilename, "\t"); + assert (dt, d); + assert (vt, v); + assert (ct, c); + delete (tempfilename); +17 tests, 17 passed, 0 known failure, 0 skipped +[inst/normstat.m] +>>>>> /build/octave-statistics-1.4.0/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/nanvar.m] +>>>>> /build/octave-statistics-1.4.0/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/raylinv.m] +>>>>> /build/octave-statistics-1.4.0/inst/raylinv.m +***** test + 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 + 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/bbsrnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/bbsrnd.m +***** assert (size (bbsrnd (0, 1, 1)), [1 1]) +***** assert (size (bbsrnd (zeros (2,1), 1, 1)), [2, 1]) +***** assert (size (bbsrnd (zeros (2,2), 1, 1)), [2, 2]) +***** assert (size (bbsrnd (0, ones (2,1), 1)), [2, 1]) +***** assert (size (bbsrnd (0, ones (2,2), 1)), [2, 2]) +***** assert (size (bbsrnd (0, 1, ones (2,1))), [2, 1]) +***** assert (size (bbsrnd (0, 1, ones (2,2))), [2, 2]) +***** assert (size (bbsrnd (0, 1, 1, 3)), [3, 3]) +***** assert (size (bbsrnd (0, 1, 1, [4 1])), [4, 1]) +***** assert (size (bbsrnd (0, 1, 1, 4, 1)), [4, 1]) +***** assert (class (bbsrnd (0,1,1)), "double") +***** assert (class (bbsrnd (single (0),1,1)), "single") +***** assert (class (bbsrnd (single ([0 0]),1,1)), "single") +***** assert (class (bbsrnd (0,single (1),1)), "single") +***** assert (class (bbsrnd (0,single ([1 1]),1)), "single") +***** assert (class (bbsrnd (0,1,single (1))), "single") +***** assert (class (bbsrnd (0,1,single ([1 1]))), "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 (ones (2),1,2, 3) +***** error bbsrnd (ones (2),1,2, [3, 2]) +***** error bbsrnd (ones (2),1,2, 3, 2) +32 tests, 32 passed, 0 known failure, 0 skipped +[inst/geostat.m] +>>>>> /build/octave-statistics-1.4.0/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/copulacdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/copulacdf.m +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + theta = [1; 2]; + p = copulacdf ("Clayton", x, theta); + expected_p = [0.1395; 0.1767]; + assert (p, expected_p, 0.001); +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + p = copulacdf ("Gumbel", x, 2); + expected_p = [0.1464; 0.1464]; + assert (p, expected_p, 0.001); +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + theta = [1; 2]; + p = copulacdf ("Frank", x, theta); + expected_p = [0.0699; 0.0930]; + assert (p, expected_p, 0.001); +***** test + x = [0.2:0.2:0.6; 0.2:0.2:0.6]; + theta = [0.3; 0.7]; + p = copulacdf ("AMH", x, theta); + expected_p = [0.0629; 0.0959]; + assert (p, expected_p, 0.001); +***** test + x = [0.2:0.2:0.6; 0.2:0.1:0.4]; + theta = [0.2, 0.1, 0.1, 0.05]; + p = copulacdf ("FGM", x, theta); + expected_p = [0.0558; 0.0293]; + assert (p, expected_p, 0.001); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/betastat.m] +>>>>> /build/octave-statistics-1.4.0/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/gevrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/raylcdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/raylcdf.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); +***** 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/raylstat.m] +>>>>> /build/octave-statistics-1.4.0/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/pdf.m] +>>>>> /build/octave-statistics-1.4.0/inst/pdf.m +***** test + assert(pdf ('norm', 1, 0, 1), normpdf (1, 0, 1)) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/gevfit.m] +>>>>> /build/octave-statistics-1.4.0/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/randsample.m] >>>>> /build/octave-statistics-1.4.0/inst/randsample.m ***** test @@ -6530,31 +6215,247 @@ x = randsample(k, k, false, 1:k); assert (size(x), [1 k]); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/linkage.m] ->>>>> /build/octave-statistics-1.4.0/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 linkage (pdist (x), "median"); -***** test warning off clustering - assert (cond (linkage (pdist (x), "median")), 27.683325,t); - warning on clustering -warning: clustering -***** 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/gpinv.m] +>>>>> /build/octave-statistics-1.4.0/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, zeros (1,5), 1, 0), y1) +***** assert (gpinv (x, 0, ones (1,5), 0), y1) +***** assert (gpinv (x, 0, 1, zeros (1,5)), y1) +***** assert (gpinv (x, 0, 1, 0), y1) +***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, NaN, 0, 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, zeros (1,5), ones (1,5), ones (1,5)), y2) +***** assert (gpinv (x, zeros (1,5), 1, 1), y2) +***** assert (gpinv (x, 0, ones (1,5), 1), y2) +***** assert (gpinv (x, 0, 1, ones (1,5)), y2) +***** assert (gpinv (x, 0, 1, 1), y2) +***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, 1), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], 1), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, 0, 1, [1, 1, NaN, 1, 1]), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, 1), [y2(1:2), NaN, y2(4:5)]) +***** assert (gpinv (x, zeros (1,5), ones (1,5), -ones (1,5)), y3) +***** assert (gpinv (x, zeros (1,5), 1, -1), y3) +***** assert (gpinv (x, 0, ones (1,5), -1), y3) +***** assert (gpinv (x, 0, 1, -ones (1,5)), y3) +***** assert (gpinv (x, 0, 1, -1), y3) +***** assert (gpinv (x, [0, 0, NaN, 0, 0], 1, -1), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (x, 0, [1, 1, NaN, 1, 1], -1), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (x, 0, 1, -[1, 1, NaN, 1, 1]), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv ([x(1:2), NaN, x(4:5)], 0, 1, -1), [y3(1:2), NaN, y3(4:5)]) +***** assert (gpinv (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], single (0), 1, 0), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], 0, single (1), 0), single ([y1, NaN])) +***** assert (gpinv ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) +***** assert (gpinv (single ([x, NaN]), 0, 1, 1), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], single (0), 1, 1), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], 0, single (1), 1), single ([y2, NaN])) +***** assert (gpinv ([x, NaN], 0, 1, single (1)), single ([y2, NaN])) +***** assert (gpinv (single ([x, NaN]), 0, 1, -1), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], single (0), 1, -1), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], 0, single (1), -1), single ([y3, NaN])) +***** assert (gpinv ([x, NaN], 0, 1, single (-1)), 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/base/crosstab.m] +>>>>> /build/octave-statistics-1.4.0/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/cloglog.m] +>>>>> /build/octave-statistics-1.4.0/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/qqplot.m] +>>>>> /build/octave-statistics-1.4.0/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/ppplot.m] +>>>>> /build/octave-statistics-1.4.0/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.0/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/logit.m] +>>>>> /build/octave-statistics-1.4.0/inst/base/logit.m +***** 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) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/tblread.m] +>>>>> /build/octave-statistics-1.4.0/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/pdist.m] +>>>>> /build/octave-statistics-1.4.0/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/sigma_pts.m] +>>>>> /build/octave-statistics-1.4.0/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/nakapdf.m] +>>>>> /build/octave-statistics-1.4.0/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/gevpdf.m] >>>>> /build/octave-statistics-1.4.0/inst/gevpdf.m ***** test @@ -6582,152 +6483,286 @@ 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/hmmestimate.m] ->>>>> /build/octave-statistics-1.4.0/inst/hmmestimate.m +[inst/burrrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/hmmgenerate.m] +>>>>> /build/octave-statistics-1.4.0/inst/hmmgenerate.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); + 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 - 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'}; + 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'}; - [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/gppdf.m] ->>>>> /build/octave-statistics-1.4.0/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, zeros (1,6), 1, 0), y1, eps) -***** assert (gppdf (x, 0, ones (1,6), 0), y1, eps) -***** assert (gppdf (x, 0, 1, zeros (1,6)), y1, eps) -***** assert (gppdf (x, 0, 1, 0), y1, eps) -***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 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, 1, [0, 0, 0, NaN, 0, 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, zeros (1,6), ones (1,6), ones (1,6)), y2, eps) -***** assert (gppdf (x, zeros (1,6), 1, 1), y2, eps) -***** assert (gppdf (x, 0, ones (1,6), 1), y2, eps) -***** assert (gppdf (x, 0, 1, ones (1,6)), y2, eps) -***** assert (gppdf (x, 0, 1, 1), y2, eps) -***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, 1), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], 1), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, 0, 1, [1, 1, 1, NaN, 1, 1]), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, 1), [y2(1:3), NaN, y2(5:6)]) -***** assert (gppdf (x, zeros (1,6), ones (1,6), -ones (1,6)), y3, eps) -***** assert (gppdf (x, zeros (1,6), 1, -1), y3, eps) -***** assert (gppdf (x, 0, ones (1,6), -1), y3, eps) -***** assert (gppdf (x, 0, 1, -ones (1,6)), y3, eps) -***** assert (gppdf (x, 0, 1, -1), y3, eps) -***** assert (gppdf (x, [0, 0, 0, NaN, 0, 0], 1, -1), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (x, 0, [1, 1, 1, NaN, 1, 1], -1), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (x, 0, 1, [-1, -1, -1, NaN, -1, -1]), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf ([x(1:3), NaN, x(5:6)], 0, 1, -1), [y3(1:3), NaN, y3(5:6)]) -***** assert (gppdf (single ([x, NaN]), 0, 1, 0), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], single (0), 1, 0), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], 0, single (1), 0), single ([y1, NaN])) -***** assert (gppdf ([x, NaN], 0, 1, single (0)), single ([y1, NaN])) -***** assert (gppdf (single ([x, NaN]), 0, 1, 1), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], single (0), 1, 1), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], 0, single (1), 1), single ([y2, NaN])) -***** assert (gppdf ([x, NaN], 0, 1, single (1)), single ([y2, NaN])) -***** assert (gppdf (single ([x, NaN]), 0, 1, -1), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], single (0), 1, -1), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], 0, single (1), -1), single ([y3, NaN])) -***** assert (gppdf ([x, NaN], 0, 1, single (-1)), 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 (3), ones (2), ones (2)) -***** error gppdf (1, ones (2), ones (3), ones (2)) -***** error gppdf (1, ones (2), ones (2), ones (3)) -***** 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/canoncorr.m] ->>>>> /build/octave-statistics-1.4.0/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); + [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/wishpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/nakacdf.m] ->>>>> /build/octave-statistics-1.4.0/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/geostat.m] ->>>>> /build/octave-statistics-1.4.0/inst/geostat.m +[inst/poisstat.m] +>>>>> /build/octave-statistics-1.4.0/inst/poisstat.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); + lambda = 1 ./ (1:6); + [m, v] = poisstat (lambda); + assert (m, lambda); + assert (v, lambda); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/wishrnd.m] ->>>>> /build/octave-statistics-1.4.0/inst/wishrnd.m -***** 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) +[inst/gamstat.m] +>>>>> /build/octave-statistics-1.4.0/inst/gamstat.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]; + 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]; + assert (m, expected_m, 0.001); + assert (v, expected_v, 0.001); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/gevstat.m] +>>>>> /build/octave-statistics-1.4.0/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/runstest.m] +>>>>> /build/octave-statistics-1.4.0/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/mahal.m] +>>>>> /build/octave-statistics-1.4.0/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/mnpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/stepwisefit.m] +>>>>> /build/octave-statistics-1.4.0/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/gevcdf.m] +>>>>> /build/octave-statistics-1.4.0/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/mnrnd.m] +>>>>> /build/octave-statistics-1.4.0/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/iwishpdf.m] +>>>>> /build/octave-statistics-1.4.0/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/gprnd.m] +>>>>> /build/octave-statistics-1.4.0/inst/gprnd.m +***** assert (size (gprnd (0,1,0)), [1, 1]) +***** assert (size (gprnd (zeros (2,1), 1,0)), [2, 1]) +***** assert (size (gprnd (zeros (2,2), 1,0)), [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 (0,1, zeros (2,1))), [2, 1]) +***** assert (size (gprnd (0,1, zeros (2,2))), [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 (0,1,1)), [1, 1]) +***** assert (size (gprnd (zeros (2,1), 1,1)), [2, 1]) +***** assert (size (gprnd (zeros (2,2), 1,1)), [2, 2]) +***** assert (size (gprnd (0, ones (2,1), 1)), [2, 1]) +***** assert (size (gprnd (0, ones (2,2), 1)), [2, 2]) +***** assert (size (gprnd (0,1, ones (2,1))), [2, 1]) +***** assert (size (gprnd (0,1, ones (2,2))), [2, 2]) +***** assert (size (gprnd (0,1, 1, 3)), [3, 3]) +***** assert (size (gprnd (0,1, 1, [4 1])), [4, 1]) +***** assert (size (gprnd (0,1, 1, 4, 1)), [4, 1]) +***** assert (size (gprnd (0,1,-1)), [1, 1]) +***** assert (size (gprnd (zeros (2,1), -1,1)), [2, 1]) +***** assert (size (gprnd (zeros (2,2), -1,1)), [2, 2]) +***** assert (size (gprnd (0, ones (2,1), -1)), [2, 1]) +***** assert (size (gprnd (0, ones (2,2), -1)), [2, 2]) +***** assert (size (gprnd (0,1, -ones (2,1))), [2, 1]) +***** assert (size (gprnd (0,1, -ones (2,2))), [2, 2]) +***** assert (size (gprnd (0,1, -1, 3)), [3, 3]) +***** assert (size (gprnd (0,1, -1, [4 1])), [4, 1]) +***** assert (size (gprnd (0,1, -1, 4, 1)), [4, 1]) +***** assert (class (gprnd (0,1,0)), "double") +***** assert (class (gprnd (single (0),1,0)), "single") +***** assert (class (gprnd (single ([0 0]),1,0)), "single") +***** assert (class (gprnd (0,single (1),0)), "single") +***** assert (class (gprnd (0,single ([1 1]),0)), "single") +***** assert (class (gprnd (0,1,single (0))), "single") +***** assert (class (gprnd (0,1,single ([0 0]))), "single") +***** error gprnd () +***** error gprnd (1) +***** error gprnd (1,2) +***** error gprnd (zeros (3), ones (2), zeros (2)) +***** error gprnd (zeros (2), ones (3), zeros (2)) +***** error gprnd (zeros (2), ones (2), zeros (3)) +***** 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 (zeros (2),1,0, 3) +***** error gprnd (zeros (2),1,0, [3, 2]) +***** error gprnd (zeros (2),1,0, 3, 2) +52 tests, 52 passed, 0 known failure, 0 skipped Checking C++ files ... Summary: 2429 tests, 2426 passed, 0 known failures, 3 skipped dh_octave_substvar -O--buildsystem=octave @@ -6756,12 +6791,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/3857/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/3857/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/7303 and its subdirectories -I: Current time: Mon Aug 14 21:01:09 -12 2023 -I: pbuilder-time-stamp: 1692090069 +I: removing directory /srv/workspace/pbuilder/3857 and its subdirectories +I: Current time: Tue Aug 15 23:31:44 +14 2023 +I: pbuilder-time-stamp: 1692091904