~ubuntu-branches/ubuntu/gutsy/mvtnorm/gutsy

« back to all changes in this revision

Viewing changes to tests/bugfix-tests.Rout.save

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2007-07-24 21:26:48 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070724212648-tkgksau1bwfxv3pm
Tags: 0.8.1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
 
R : Copyright 2006, The R Foundation for Statistical Computing
3
 
Version 2.3.1 (2006-06-01)
 
2
R version 2.5.1 (2007-06-27)
 
3
Copyright (C) 2007 The R Foundation for Statistical Computing
4
4
ISBN 3-900051-07-0
5
5
 
6
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
179
179
+                     c(Inf, 0), 0)))
180
180
181
181
> # this is a bug in `mvtdst' nobody was able to fix yet :-(
182
 
> stopifnot(pmvnorm(lo=c(-Inf,-Inf), up=c(Inf,Inf), mean=c(0,0) == 0)
183
 
 
182
> stopifnot(pmvnorm(lo=c(-Inf,-Inf), up=c(Inf,Inf), mean=c(0,0)) == 1)
 
183
 
184
> ### check for correct random seed initialization
 
185
> ### problem reported by Karen Conneely <conneely@umich.edu>
 
186
> dm <- 250000
 
187
> iters <- 2
 
188
> corr <- .7
 
189
> dim <- 100
 
190
> abserr <- .0000035
 
191
> cutoff <- -5.199338
 
192
> mn <- rep(0,dim)
 
193
> mat <- diag(dim)
 
194
> for (i in 1:dim) {
 
195
+     for (j in 1:(i-1)) {
 
196
+         mat[i,j]=mat[j,i]=corr^(i-j)
 
197
+     }
 
198
+ }
 
199
> ll <- rep(cutoff, dim)
 
200
> mn <- rep(0, dim)
 
201
> p <- matrix(0, iters,1)
 
202
 
203
> set.seed(290875)
 
204
> for (i in 1:iters) {
 
205
+    pp <- pmvnorm(lower=ll, sigma=mat, maxpts=dm, abseps=abserr)
 
206
+    p[i] <- 1-pp
 
207
+ }
 
208
> stopifnot(abs(p[1] - p[2]) < 2 * abserr)
 
209
> ptmp <- p
 
210
> set.seed(290875)
 
211
> for (i in 1:iters) {
 
212
+    pp <- pmvnorm(lower=ll, sigma=mat, maxpts=dm, abseps=abserr)
 
213
+    p[i] <- 1-pp
 
214
+ }
 
215
> stopifnot(all.equal(p, ptmp))
 
216