-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix mixcdf to work when mixture has only one component by using aaply…
… instead of vapply
- Loading branch information
1 parent
0de6ae0
commit 1056b5e
Showing
5 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
Package: ashr | ||
Maintainer: Matthew Stephens <[email protected]> | ||
Author: Matthew Stephens, Chaoxing Dai, Mengyin Lu | ||
Version: 0.9 | ||
Version: 0.9.1 | ||
License: GPL-3 | ||
Title: Methods for Adaptive Shrinkage, using Empirical Bayes | ||
Description: TBA | ||
Depends: | ||
truncnorm, | ||
plyr, | ||
SQUAREM, | ||
doParallel, | ||
pscl, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% Generated by roxygen2 (4.1.0): do not edit by hand | ||
% Please edit documentation in R/mix.R | ||
\name{pcdf_post} | ||
\alias{pcdf_post} | ||
\title{pcdf_post} | ||
\usage{ | ||
pcdf_post(m, c, betahat, sebetahat, v) | ||
} | ||
\arguments{ | ||
\item{m}{mixture distribution with k components} | ||
|
||
\item{c}{a numeric vector with n elements} | ||
|
||
\item{betahat}{an n vector of observations} | ||
|
||
\item{sebetahat}{an n vector of standard errors} | ||
|
||
\item{v}{degree of freedom of error distribution (scalar)} | ||
} | ||
\value{ | ||
an n vector, whose ith element is the cdf for beta_i at c_i | ||
} | ||
\description{ | ||
``parallel" vector version of \code{\link{cdf_post}} where c is a vector, of same length as betahat and sebetahat | ||
} | ||
\examples{ | ||
beta = rnorm(100,0,1) | ||
betahat= beta+rnorm(100,0,1) | ||
sebetahat=rep(1,100) | ||
ash.beta = ash(betahat,1,mixcompdist="normal") | ||
c = pcdf_post(ash.beta$fitted.g,beta,betahat,sebetahat,NULL) | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% Generated by roxygen2 (4.1.0): do not edit by hand | ||
% Please edit documentation in R/mix.R | ||
\name{vcdf_post} | ||
\alias{vcdf_post} | ||
\title{vcdf_post} | ||
\usage{ | ||
vcdf_post(m, c, betahat, sebetahat, v) | ||
} | ||
\arguments{ | ||
\item{m}{mixture distribution with k components} | ||
|
||
\item{c}{a numeric vector} | ||
|
||
\item{betahat}{an n vector of observations} | ||
|
||
\item{sebetahat}{an n vector of standard errors} | ||
|
||
\item{v}{degree of freedom of error distribution} | ||
} | ||
\value{ | ||
an n vector containing the cdf for beta_i at c | ||
} | ||
\description{ | ||
vectorized version of \code{\link{cdf_post}} | ||
} | ||
\examples{ | ||
beta = rnorm(100,0,1) | ||
betahat= beta+rnorm(100,0,1) | ||
sebetahat=rep(1,100) | ||
ash.beta = ash(betahat,1,mixcompdist="normal") | ||
c = vcdf_post(ash.beta$fitted.g,seq(-5,5,length=1000),betahat,sebetahat,NULL) | ||
} | ||
|