Skip to content

Commit

Permalink
Added seed option to function docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaceresb committed Jul 10, 2024
1 parent dd56898 commit 4adfc6c
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 16 deletions.
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaRM.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ computeConditionalCS_DeltaRM(betahat, sigma, numPrePeriods, numPostPeriods,
l_vec = .basisVector(index = 1, size = numPostPeriods), Mbar = 0,
alpha = 0.05, hybrid_flag = "LF", hybrid_kappa = alpha/10,
returnLength = FALSE, postPeriodMomentsOnly = TRUE,
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -58,6 +58,9 @@ Logical value. If TRUE, function only returns the length of the robust confidenc
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaRMB.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ computeConditionalCS_DeltaRMB(betahat, sigma, numPrePeriods, numPostPeriods,
Mbar = 0, alpha = 0.05, hybrid_flag = "LF",
hybrid_kappa = alpha/10, returnLength = FALSE,
biasDirection = "positive", postPeriodMomentsOnly = TRUE,
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -63,6 +63,9 @@ Logical value. If TRUE, function only returns the length of the robust confidenc
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaRMM.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ computeConditionalCS_DeltaRMM(betahat, sigma, numPrePeriods, numPostPeriods,
alpha = 0.05, hybrid_flag = "LF", hybrid_kappa = alpha/10,
returnLength = FALSE, postPeriodMomentsOnly = TRUE,
monotonicityDirection = "increasing",
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -64,6 +64,9 @@ Specifies direction of monotonicity restriction. If "increasing", underlying tre
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaSD.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ computeConditionalCS_DeltaSD(betahat, sigma, numPrePeriods, numPostPeriods,
M = 0, alpha = 0.05, hybrid_flag = "FLCI",
hybrid_kappa = alpha/10, returnLength = FALSE,
postPeriodMomentsOnly = TRUE,
gridPoints =10^3, grid.ub = NA, grid.lb = NA)
gridPoints =10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -59,6 +59,9 @@ Logical value. If TRUE, function only returns the length of the robust confidenc
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaSDB.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ computeConditionalCS_DeltaSDB(betahat, sigma, numPrePeriods, numPostPeriods,
alpha = 0.05, hybrid_flag = "FLCI", hybrid_kappa = alpha/10,
returnLength = FALSE, biasDirection = "positive",
postPeriodMomentsOnly = TRUE,
gridPoints = 10^3, grid.lb = NA, grid.ub = NA)
gridPoints = 10^3, grid.lb = NA, grid.ub = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -62,6 +62,9 @@ Logical value. If TRUE, function only returns the length of the robust confidenc
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaSDM.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ computeConditionalCS_DeltaSDM(betahat, sigma, numPrePeriods, numPostPeriods,
alpha = 0.05, monotonicityDirection = "increasing",
hybrid_flag = "FLCI", hybrid_kappa = alpha/10,
returnLength = FALSE, postPeriodMomentsOnly = TRUE,
gridPoints = 10^3, grid.lb = NA, grid.ub = NA)
gridPoints = 10^3, grid.lb = NA, grid.ub = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -62,6 +62,9 @@ Specifies direction of monotonicity restriction. If "increasing", underlying tre
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals NA sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
If returnLength equals TRUE, function returns a scalar that equals the length of the confidence interval. If returnLength equals FALSE, function returns a dataframe with columns
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaSDRM.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ computeConditionalCS_DeltaSDRM(betahat, sigma, numPrePeriods, numPostPeriods,
l_vec = .basisVector(index = 1, size = numPostPeriods), Mbar = 0,
alpha = 0.05, hybrid_flag = "LF", hybrid_kappa = alpha/10,
returnLength = FALSE, postPeriodMomentsOnly = TRUE,
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -58,6 +58,9 @@ Logical value. If \code{TRUE}, function only returns the length of the robust co
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals \code{NA} sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\details{
For the choice \eqn{\Delta^{SDRM}}, \code{numPrePeriods} must be greater than one. As discussed in Section 2.3.2 of Rambachan & Roth (2021), \eqn{\Delta^{SDRM}} uses observed non-linearities in the pre-treatment difference in trends to bound the possible non-linearities in the post-treatment difference in trends. This is only possible if there are multiple pre-treatment periods (i.e., \code{numPrePeriods} > 1).
Expand Down
5 changes: 4 additions & 1 deletion man/computeConditionalCS_DeltaSDRMB.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ computeConditionalCS_DeltaSDRMB(betahat, sigma, numPrePeriods, numPostPeriods,
Mbar = 0, alpha = 0.05, hybrid_flag = "LF",
hybrid_kappa = alpha/10, returnLength = FALSE,
postPeriodMomentsOnly = TRUE, biasDirection = "positive",
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -62,6 +62,9 @@ Logical value. If \code{TRUE}, function only returns the length of the robust co
\item{grid.lb}{
Lower bound of grid for test inversion. The user should only specify this if she wishes to manually specify the upper bound of the grid. Default equals \code{NA} sets grid lower bound to equal the lower bound of the identified set under parallel trends minus 20*standard deviation of the point estimate, l_vec'betahat.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\details{
The choice \eqn{\Delta^{SDRMB}} adds an additional sign restriction to \eqn{\Delta^{SDRM}(Mbar)} that restricts the sign of the bias to be either positive (\eqn{\delta \ge 0}) or negative (\eqn{\delta \le 0}). For this choice \eqn{\Delta^{SDRMB}}, \code{numPrePeriods} must be greater than one. As discussed in Section 2.3.2 of Rambachan & Roth (2021), \eqn{\Delta^{SDRM}} uses observed non-linearities in the pre-treatment difference in trends to bound the possible non-linearities in the post-treatment difference in trends. This is only possible if there are multiple pre-treatment periods (i.e., \code{numPrePeriods} > 1).
Expand Down
2 changes: 1 addition & 1 deletion man/computeConditionalCS_DeltaSDRMM.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ computeConditionalCS_DeltaSDRMM(betahat, sigma, numPrePeriods, numPostPeriods,
hybrid_kappa = alpha/10, returnLength = FALSE,
postPeriodMomentsOnly = TRUE,
monotonicityDirection = "increasing",
gridPoints=10^3, grid.ub = NA, grid.lb = NA)
gridPoints=10^3, grid.ub = NA, grid.lb = NA, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down
18 changes: 13 additions & 5 deletions man/createSensitivityResults.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
Constructs robust confidence intervals for a choice \eqn{\Delta = \Delta^{SD}(M)}, \eqn{\Delta^{SDB}(M)} and \eqn{\Delta^{SDM}(M)} for vector of possible M values. By default, the function constructs robust confidence intervals for \eqn{\Delta^{SD}(M)}.
}
\usage{
createSensitivityResults(betahat, sigma, numPrePeriods, numPostPeriods,
method = NULL, Mvec = NULL,
l_vec = .basisVector(index = 1, size = numPostPeriods),
monotonicityDirection = NULL,
biasDirection = NULL, alpha = 0.05, parallel = FALSE)
createSensitivityResults(betahat, sigma,
numPrePeriods, numPostPeriods,
method = NULL,
Mvec = NULL,
l_vec = .basisVector(index = 1, size = numPostPeriods),
monotonicityDirection = NULL,
biasDirection = NULL,
alpha = 0.05,
parallel = FALSE,
seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -49,6 +54,9 @@ createSensitivityResults(betahat, sigma, numPrePeriods, numPostPeriods,
\item{parallel}{
Logical to indicate whether the user would like to construct the robust confidence intervals in parallel. This uses the Foreach package and doParallel package. Default equals FALSE.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
Returns a dataframe with columns
Expand Down
6 changes: 5 additions & 1 deletion man/createSensitivityResults_relativeMagnitudes.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ createSensitivityResults_relativeMagnitudes(betahat, sigma,
gridPoints = 10^3,
grid.ub = NA,
grid.lb = NA,
parallel = FALSE)
parallel = FALSE,
seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -70,6 +71,9 @@ createSensitivityResults_relativeMagnitudes(betahat, sigma,
\item{grid.lb}{
Lower bound of grid used for underlying test inversion. Default sets grid.lb to be equal to negative twenty times the standard deviation of the estimated target parameter, l_vec * betahat. User may wish to change the lower bound of the grid to suit their application.
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\details{
Note: If the user specifies bound = "deviation from linear trends", then numPrePeriods must be greater than one. By specifying bound = "deviation from linear trends", then the function selects \eqn{\Delta^{SDRM}} as the base choice of \eqn{\Delta}. As discussed in Section 2.3.2 of Rambachan & Roth (2021), \eqn{\Delta^{SDRM}} uses observed non-linearities in the pre-treatment difference in trends to bound the possible non-linearities in the post-treatment difference in trends. This is only possible if there are multiple pre-treatment periods (i.e., numPrePeriods > 1).
Expand Down
5 changes: 4 additions & 1 deletion man/findOptimalFLCI.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Constructs optimal fixed length confidence interval for \eqn{\Delta = \Delta^{SD
findOptimalFLCI(betahat, sigma, M = 0,
numPrePeriods, numPostPeriods,
l_vec = .basisVector(index = 1, size = numPostPeriods),
numPoints = 100, alpha = 0.05)
numPoints = 100, alpha = 0.05, seed = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand Down Expand Up @@ -39,6 +39,9 @@ findOptimalFLCI(betahat, sigma, M = 0,
\item{alpha}{
Desired size of the FLCI. Default equals 0.05 (corresponding to 95\% confidence interval)
}
\item{seed}{
Random seed for internal computations; included for reproducibility.
}
}
\value{
Returns a list containing items
Expand Down

0 comments on commit 4adfc6c

Please sign in to comment.