## Create a sample of size 100 for a
## Gaussian distribution
mvpdf <- function (x) { exp(-sum(x^2)) }
x <- urhitro(20, dim=2, pdf=mvpdf)
x
## use:
## mode at (0,0)
## thinning factor 3
## (only every 3rd vector in the sequence is returned)
## burn-in of length 100
## (the first 1000 vectors in the sequence are discarded)
x <- urhitro(20, dim=2, pdf=mvpdf, mode=c(0,0), thinning=3, burnin=100)
x
## Create a sample of size 100 for a
## Gaussian distribution restricted to first quadrant
mvpdf <- function (x) { exp(-sum(x^2)) }
x <- urhitro(20, dim=2, pdf=mvpdf, ll=c(0,0), ur=c(Inf,Inf))
x
## Create a sample of size 100 for a
## Gaussian distribution restricted to the rectangle [1,2]x[1,2]
## (don't forget to provide a starting point using 'center')
mvpdf <- function (x) { exp(-sum(x^2)) }
x <- urhitro(20, dim=2, pdf=mvpdf, center=c(1.1,1.1), ll=c(1,1), ur=c(2,2))
xRun the code above in your browser using DataLab