Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CompPack/CompPack.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
Empty file added CompPack/debug.log
Empty file.
2 changes: 1 addition & 1 deletion R/pois.proc.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Generate a Poisson Process
#'
#' @param end the end time.
#' @param end the end time desired.
#' @param rate the rate of occurrence.
#'
#' @author Tyler Hunt \email{tyler@@psychoanalytix.com}
Expand Down
28 changes: 21 additions & 7 deletions R/rand.norm.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#' Generate Random Normal Variables
#' Generate A Random Normal Variable
#'
#' @param n Number of observations
#' @param mean vector of means
#' @param sd vector of standard deviations
#' @description A method for generating a random normal variable based upon the polar method.
#' @param mu mean of a normal distribution
#' @param sigma variance of a normal distribution
#'
#' @author Tyler Hunt \email{tyler@@psychoanalytix.com}
#' @author Damon McCafferty \email{damon.mccafferty@@economics.utah.edu}
#'
#' @export

rand.norm<-function(n, mean, sd){
qnorm( replicate( n, wich.hill() ) )*sd + mean
function(mu,sig)
{

u<-(2*wichmannhill()-1)
v<-(2*wichmannhill()-1)

s<-u^2+v^2

while(s==0||s>=1)
{
u<-(2*wichmannhill()-1)
v<-(2*wichmannhill()-1)

s<-u^2+v^2
}
sig*sqrt(-2*log(s)/s)*u + mu
}
6 changes: 3 additions & 3 deletions R/rand.unif.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Generate Random Uniform Variables
#'
#' @param n Number of observations
#' @param min lower limit of the distribution
#' @param max upper limit of the distribution
#' @param n Number of observations.
#' @param min lower limit of the distribution.
#' @param max upper limit of the distribution.
#'
#' @author Tyler Hunt \email{tyler@@psychoanalytix.com}
#'
Expand Down
Empty file added debug.log
Empty file.