From: Thomas F. <tho...@ru...> - 2015-01-22 21:40:30
|
Git commit 5b742e59b7bef0abe20b26653ac4e7ea915319be by Thomas Friedrichsmeier. Committed on 22/01/2015 at 21:37. Pushed by tfry into branch 'work/distributions'. Start working on the mass conversion of distribution plugins. Unfinished. M +84 -121 rkward/plugins/distributions.pluginmap M +1 -5 rkward/plugins/distributions/beta.js A +22 -0 rkward/plugins/distributions/beta.rkh M +2 -1 rkward/plugins/distributions/beta.xml M +1 -6 rkward/plugins/distributions/binomial.js M +4 -6 rkward/plugins/distributions/binomial.rkh A +5 -0 rkward/plugins/distributions/cauchy.js A +0 -0 rkward/plugins/distributions/cauchy.rkh R +7 -3 rkward/plugins/distributions/cauchy.xml [from: rkward/plugins/distributions/cauchy_probabilities.xml - 063% similarity] D +0 -14 rkward/plugins/distributions/cauchy_probabilities.js D +0 -14 rkward/plugins/distributions/cauchy_quantiles.js D +0 -14 rkward/plugins/distributions/cauchy_quantiles.xml A +5 -0 rkward/plugins/distributions/chi_squared.js A +0 -0 rkward/plugins/distributions/chi_squared.rkh R +7 -3 rkward/plugins/distributions/chi_squared.xml [from: rkward/plugins/distributions/chi_squared_quantiles.xml - 063% similarity] D +0 -14 rkward/plugins/distributions/chi_squared_probabilities.js D +0 -14 rkward/plugins/distributions/chi_squared_quantiles.js M +23 -6 rkward/plugins/distributions/dist_common.js M +3 -0 rkward/plugins/distributions/dist_help_snippets.xml A +5 -0 rkward/plugins/distributions/exponential.js A +0 -0 rkward/plugins/distributions/exponential.rkh R +7 -3 rkward/plugins/distributions/exponential.xml [from: rkward/plugins/distributions/exponential_probabilities.xml - 055% similarity] D +0 -14 rkward/plugins/distributions/exponential_probabilities.js D +0 -14 rkward/plugins/distributions/exponential_quantiles.js D +0 -13 rkward/plugins/distributions/exponential_quantiles.xml A +5 -0 rkward/plugins/distributions/f.js A +0 -0 rkward/plugins/distributions/f.rkh R +7 -3 rkward/plugins/distributions/f.xml [from: rkward/plugins/distributions/f_probabilities.xml - 073% similarity] D +0 -14 rkward/plugins/distributions/f_probabilities.js D +0 -14 rkward/plugins/distributions/f_quantiles.js D +0 -15 rkward/plugins/distributions/f_quantiles.xml A +5 -0 rkward/plugins/distributions/gamma.js A +0 -0 rkward/plugins/distributions/gamma.rkh R +7 -3 rkward/plugins/distributions/gamma.xml [from: rkward/plugins/distributions/gamma_probabilities.xml - 064% similarity] D +0 -14 rkward/plugins/distributions/gamma_probabilities.js D +0 -15 rkward/plugins/distributions/gamma_quantiles.js D +0 -14 rkward/plugins/distributions/gamma_quantiles.xml A +5 -0 rkward/plugins/distributions/geom.js A +0 -0 rkward/plugins/distributions/geom.rkh R +7 -3 rkward/plugins/distributions/geom.xml [from: rkward/plugins/distributions/geom_probabilities.xml - 060% similarity] D +0 -14 rkward/plugins/distributions/geom_probabilities.js D +0 -14 rkward/plugins/distributions/geom_quantiles.js D +0 -13 rkward/plugins/distributions/geom_quantiles.xml R +8 -0 rkward/plugins/distributions/gumbel.js [from: rkward/plugins/distributions/gumbel_probabilities.js - 080% similarity] A +0 -0 rkward/plugins/distributions/gumbel.rkh R +7 -3 rkward/plugins/distributions/gumbel.xml [from: rkward/plugins/distributions/gumbel_probabilities.xml - 063% similarity] D +0 -14 rkward/plugins/distributions/gumbel_quantiles.js D +0 -14 rkward/plugins/distributions/gumbel_quantiles.xml A +7 -0 rkward/plugins/distributions/hypergeometric.js A +0 -0 rkward/plugins/distributions/hypergeometric.rkh R +6 -2 rkward/plugins/distributions/hypergeometric.xml [from: rkward/plugins/distributions/hypergeometric_probabilities.xml - 073% similarity] D +0 -14 rkward/plugins/distributions/hypergeometric_probabilities.js D +0 -14 rkward/plugins/distributions/hypergeometric_quantiles.js D +0 -15 rkward/plugins/distributions/hypergeometric_quantiles.xml A +5 -0 rkward/plugins/distributions/log_normal.js A +0 -0 rkward/plugins/distributions/log_normal.rkh R +7 -3 rkward/plugins/distributions/log_normal.xml [from: rkward/plugins/distributions/log_normal_probabilities.xml - 068% similarity] D +0 -14 rkward/plugins/distributions/log_normal_probabilities.js D +0 -14 rkward/plugins/distributions/log_normal_quantiles.js D +0 -14 rkward/plugins/distributions/log_normal_quantiles.xml A +5 -0 rkward/plugins/distributions/logistic.js A +0 -0 rkward/plugins/distributions/logistic.rkh R +7 -3 rkward/plugins/distributions/logistic.xml [from: rkward/plugins/distributions/logistic_probabilities.xml - 063% similarity] D +0 -14 rkward/plugins/distributions/logistic_probabilities.js D +0 -14 rkward/plugins/distributions/logistic_quantiles.js D +0 -14 rkward/plugins/distributions/logistic_quantiles.xml A +5 -0 rkward/plugins/distributions/negative_binomial.js A +0 -0 rkward/plugins/distributions/negative_binomial.rkh R +7 -3 rkward/plugins/distributions/negative_binomial.xml [from: rkward/plugins/distributions/negative_binomial_quantiles.xml - 063% similarity] D +0 -14 rkward/plugins/distributions/negative_binomial_probabilities.js D +0 -14 rkward/plugins/distributions/negative_binomial_probabilities.xml D +0 -14 rkward/plugins/distributions/negative_binomial_quantiles.js A +5 -0 rkward/plugins/distributions/normal.js A +0 -0 rkward/plugins/distributions/normal.rkh R +7 -3 rkward/plugins/distributions/normal.xml [from: rkward/plugins/distributions/normal_probabilities.xml - 064% similarity] D +0 -14 rkward/plugins/distributions/normal_probabilities.js D +0 -14 rkward/plugins/distributions/normal_quantiles.js D +0 -14 rkward/plugins/distributions/normal_quantiles.xml A +5 -0 rkward/plugins/distributions/poisson.js A +0 -0 rkward/plugins/distributions/poisson.rkh R +7 -3 rkward/plugins/distributions/poisson.xml [from: rkward/plugins/distributions/poisson_quantiles.xml - 056% similarity] D +0 -14 rkward/plugins/distributions/poisson_probabilities.js D +0 -13 rkward/plugins/distributions/poisson_probabilities.xml D +0 -14 rkward/plugins/distributions/poisson_quantiles.js A +5 -0 rkward/plugins/distributions/t.js A +0 -0 rkward/plugins/distributions/t.rkh R +7 -3 rkward/plugins/distributions/t.xml [from: rkward/plugins/distributions/chi_squared_probabilities.xml - 067% similarity] D +0 -14 rkward/plugins/distributions/t_probabilities.js D +0 -14 rkward/plugins/distributions/t_probabilities.xml D +0 -14 rkward/plugins/distributions/t_quantiles.js D +0 -14 rkward/plugins/distributions/t_quantiles.xml A +5 -0 rkward/plugins/distributions/tukey.js A +0 -0 rkward/plugins/distributions/tukey.rkh R +7 -3 rkward/plugins/distributions/tukey.xml [from: rkward/plugins/distributions/tukey_probabilities.xml - 069% similarity] D +0 -14 rkward/plugins/distributions/tukey_probabilities.js D +0 -14 rkward/plugins/distributions/tukey_quantiles.js D +0 -15 rkward/plugins/distributions/tukey_quantiles.xml A +5 -0 rkward/plugins/distributions/uniform.js A +0 -0 rkward/plugins/distributions/uniform.rkh R +7 -3 rkward/plugins/distributions/uniform.xml [from: rkward/plugins/distributions/uniform_probabilities.xml - 065% similarity] D +0 -14 rkward/plugins/distributions/uniform_probabilities.js D +0 -14 rkward/plugins/distributions/uniform_quantiles.js D +0 -14 rkward/plugins/distributions/uniform_quantiles.xml A +5 -0 rkward/plugins/distributions/weibull.js A +0 -0 rkward/plugins/distributions/weibull.rkh R +7 -3 rkward/plugins/distributions/weibull.xml [from: rkward/plugins/distributions/weibull_probabilities.xml - 064% similarity] D +0 -14 rkward/plugins/distributions/weibull_probabilities.js D +0 -14 rkward/plugins/distributions/weibull_quantiles.js D +0 -14 rkward/plugins/distributions/weibull_quantiles.xml A +5 -0 rkward/plugins/distributions/wilcoxon.js A +0 -0 rkward/plugins/distributions/wilcoxon.rkh R +7 -3 rkward/plugins/distributions/wilcoxon.xml [from: rkward/plugins/distributions/wilcoxon_probabilities.xml - 064% similarity] D +0 -14 rkward/plugins/distributions/wilcoxon_probabilities.js D +0 -14 rkward/plugins/distributions/wilcoxon_quantiles.js D +0 -14 rkward/plugins/distributions/wilcoxon_quantiles.xml http://commits.kde.org/rkward/5b742e59b7bef0abe20b26653ac4e7ea915319be diff --git a/rkward/plugins/distributions.pluginmap b/rkward/plugins/distributions.pluginmap index 8864e70..1e24fef 100644 --- a/rkward/plugins/distributions.pluginmap +++ b/rkward/plugins/distributions.pluginmap @@ -17,7 +17,6 @@ <components> <!-- tests --> - <component type="standard" id="shapiro_test" file="tests/shapiro_test.xml" label="Shapiro-Wilk Normality Test" /> <component type="standard" id="ad_test" file="tests/ad_test.xml" label="Anderson-Darling Normality Test" /> <component type="standard" id="cvm_test" file="tests/cvm_test.xml" label="Cramer-von Mises Normality Test" /> @@ -27,81 +26,63 @@ <component type="standard" id="jb_test" file="tests/jb_test.xml" label="Jarque-Bera Normality Test" /> <!-- distributions --> - <component type="standard" id="beta_probabilities" file="beta.xml" label="Beta probabilities" /> + <component type="standard" id="beta_probabilities" file="beta.xml" label="Beta distribution calculator" /> <component type="standard" id="plot_beta_distribution" file="plot_beta_distribution.xml" label="Plot Beta distribution" /> - <component type="standard" id="binomial_probabilities" file="binomial.xml" label="Binomial probabilities, quantiles, densities" /> + <component type="standard" id="binomial_probabilities" file="binomial.xml" label="Binomial distribution calculator" /> <component type="standard" id="plot_binomial_distribution" file="plot_binomial_distribution.xml" label="Plot binomial distribution" /> - <component type="standard" id="cauchy_quantiles" file="cauchy_quantiles.xml" label="Cauchy quantiles" /> - <component type="standard" id="cauchy_probabilities" file="cauchy_probabilities.xml" label="Cauchy probabilities" /> + <component type="standard" id="cauchy_probabilities" file="cauchy.xml" label="Cauchy distribution calculator" /> <component type="standard" id="plot_cauchy_distribution" file="plot_cauchy_distribution.xml" label="Plot Cauchy distribution" /> - <component type="standard" id="chi_squared_quantiles" file="chi_squared_quantiles.xml" label="Chi-squared quantiles" /> - <component type="standard" id="chi_squared_probabilities" file="chi_squared_probabilities.xml" label="Chi-squared probabilities" /> + <component type="standard" id="chi_squared_probabilities" file="chi_squared.xml" label="Chi-squared distribution calculator" /> <component type="standard" id="plot_chi_squared_distribution" file="plot_chi_squared_distribution.xml" label="Plot Chi-squared distribution" /> - <component type="standard" id="exponential_quantiles" file="exponential_quantiles.xml" label="Exponential quantiles" /> - <component type="standard" id="exponential_probabilities" file="exponential_probabilities.xml" label="Exponential probabilities" /> + <component type="standard" id="exponential_probabilities" file="exponential.xml" label="Exponential probabilities" /> <component type="standard" id="plot_exponential_distribution" file="plot_exponential_distribution.xml" label="Plot Exponential distribution" /> - <component type="standard" id="f_quantiles" file="f_quantiles.xml" label="F quantiles" /> - <component type="standard" id="f_probabilities" file="f_probabilities.xml" label="F probabilities" /> + <component type="standard" id="f_probabilities" file="f.xml" label="F distribution calculator" /> <component type="standard" id="plot_f_distribution" file="plot_f_distribution.xml" label="Plot F distribution" /> - <component type="standard" id="gamma_quantiles" file="gamma_quantiles.xml" label="Gamma quantiles" /> - <component type="standard" id="gamma_probabilities" file="gamma_probabilities.xml" label="Gamma probabilities" /> + <component type="standard" id="gamma_probabilities" file="gamma.xml" label="Gamma distribution calculator" /> <component type="standard" id="plot_gamma_distribution" file="plot_gamma_distribution.xml" label="Plot Gamma distribution" /> - <component type="standard" id="geom_quantiles" file="geom_quantiles.xml" label="Geometric quantiles" /> - <component type="standard" id="geom_probabilities" file="geom_probabilities.xml" label="Geometric probabilities" /> + <component type="standard" id="geom_probabilities" file="geom.xml" label="Geometric distribution calculator" /> <component type="standard" id="plot_geometric_distribution" file="plot_geometric_distribution.xml" label="Plot Geometric distribution" /> - <component type="standard" id="gumbel_quantiles" file="gumbel_quantiles.xml" label="Gumbel quantiles" /> - <component type="standard" id="gumbel_probabilities" file="gumbel_probabilities.xml" label="Gumbel probabilities" /> + <component type="standard" id="gumbel_probabilities" file="gumbel.xml" label="Gumbel distribution calculator" /> - <component type="standard" id="hypergeometric_quantiles" file="hypergeometric_quantiles.xml" label="Hypergeometric quantiles" /> - <component type="standard" id="hypergeometric_probabilities" file="hypergeometric_probabilities.xml" label="Hypergeometric probabilities" /> + <component type="standard" id="hypergeometric_probabilities" file="hypergeometric.xml" label="Hypergeometric distribution calculator" /> <component type="standard" id="plot_hypergeometric_distribution" file="plot_hypergeometric_distribution.xml" label="Plot Hypergeometric distribution" /> - <component type="standard" id="logistic_quantiles" file="logistic_quantiles.xml" label="Logistic quantiles" /> - <component type="standard" id="logistic_probabilities" file="logistic_probabilities.xml" label="Logistic probabilities" /> + <component type="standard" id="logistic_probabilities" file="logistic.xml" label="Logistic distribution calculator" /> <component type="standard" id="plot_logistic_distribution" file="plot_logistic_distribution.xml" label="Plot Logistic distribution" /> - <component type="standard" id="log_normal_quantiles" file="log_normal_quantiles.xml" label="Log Normal quantiles" /> - <component type="standard" id="log_normal_probabilities" file="log_normal_probabilities.xml" label="Log Normal probabilities" /> - <component type="standard" id="plot_lognormal_distribution" file="plot_lognormal_distribution.xml" label="Plot Lognormal distribution" /> + <component type="standard" id="log_normal_probabilities" file="log_normal.xml" label="Log Normal distribution calculator" /> + <component type="standard" id="plot_lognormal_distribution" file="plot_lognormal_distribution.xml" label="Plot Log Normal distribution" /> - <component type="standard" id="negative_binomial_quantiles" file="negative_binomial_quantiles.xml" label="Negative Binomial quantiles" /> - <component type="standard" id="negative_binomial_probabilities" file="negative_binomial_probabilities.xml" label="Negative Binomial probabilities" /> + <component type="standard" id="negative_binomial_probabilities" file="negative_binomial.xml" label="Negative Binomial distribution calculator" /> <component type="standard" id="plot_negbinomial_distribution" file="plot_negbinomial_distribution.xml" label="Plot Negative Binomial distribution" /> - <component type="standard" id="normal_quantiles" file="normal_quantiles.xml" label="Normal quantiles" /> - <component type="standard" id="normal_probabilities" file="normal_probabilities.xml" label="Normal probabilities" /> + <component type="standard" id="normal_probabilities" file="normal.xml" label="Normal distribution calculator" /> <component type="standard" id="plot_normal_distribution" file="plot_normal_distribution.xml" label="Plot Normal distribution" /> - <component type="standard" id="poisson_quantiles" file="poisson_quantiles.xml" label="Poisson quantiles" /> - <component type="standard" id="poisson_probabilities" file="poisson_probabilities.xml" label="Poisson probabilities" /> + <component type="standard" id="poisson_probabilities" file="poisson.xml" label="Poisson distribution calculator" /> <component type="standard" id="plot_poisson_distribution" file="plot_poisson_distribution.xml" label="Plot Poisson distribution" /> - <component type="standard" id="t_quantiles" file="t_quantiles.xml" label="t quantiles" /> - <component type="standard" id="t_probabilities" file="t_probabilities.xml" label="t probabilities" /> + <component type="standard" id="t_probabilities" file="t.xml" label="t distribution calculator" /> <component type="standard" id="plot_t_distribution" file="plot_t_distribution.xml" label="Plot t distribution" /> - <component type="standard" id="tukey_probabilities" file="tukey_probabilities.xml" label="Studentized Range probabilities (Tukey)" /> - <component type="standard" id="tukey_quantiles" file="tukey_quantiles.xml" label="Studentized Range quantiles (Tukey)" /> + <component type="standard" id="tukey_probabilities" file="tukey.xml" label="Studentized Range (Tukey) distribution calculator" /> <component type="standard" id="plot_tukey_distribution" file="plot_tukey_distribution.xml" label="Plot Studentized Range (Tukey) distribution" /> - <component type="standard" id="uniform_quantiles" file="uniform_quantiles.xml" label="Uniform quantiles" /> - <component type="standard" id="uniform_probabilities" file="uniform_probabilities.xml" label="Uniform probabilities" /> + <component type="standard" id="uniform_probabilities" file="uniform.xml" label="Uniform distribution calculator" /> <component type="standard" id="plot_uniform_distribution" file="plot_uniform_distribution.xml" label="Plot Uniform distribution" /> - <component type="standard" id="weibull_quantiles" file="weibull_quantiles.xml" label="Weibull quantiles" /> - <component type="standard" id="weibull_probabilities" file="weibull_probabilities.xml" label="Weibull probabilities" /> + <component type="standard" id="weibull_probabilities" file="weibull.xml" label="Weibull distribution calculator" /> <component type="standard" id="plot_weibull_distribution" file="plot_weibull_distribution.xml" label="Plot Weibull distribution" /> - <component type="standard" id="wilcoxon_quantiles" file="wilcoxon_quantiles.xml" label="Wilcoxon Rank Sum quantiles" /> - <component type="standard" id="wilcoxon_probabilities" file="wilcoxon_probabilities.xml" label="Wilcoxon Rank Sum probabilities" /> + <component type="standard" id="wilcoxon_probabilities" file="wilcoxon.xml" label="Wilcoxon Rank Sum distribution calculator" /> <component type="standard" id="plot_wilcoxon_distribution" file="plot_wilcoxon_distribution.xml" label="Plot Wilcoxon Rank Sum distribution" /> @@ -129,131 +110,113 @@ <hierarchy> <menu id="distributions" label="Distributions"> <menu id="distribution_analysis" label="Distribution Analysis"> - <entry component="ad_test" label="Anderson-Darling Normality Test"/> - <entry component="cvm_test" label="Cramer-von Mises Normality Test"/> - <entry component="lillie_test" label="Lilliefors (Kolmogorov-Smirnov) Normality Test"/> - <entry component="pearson_test" label="Pearson chi-square Normality Test"/> - <entry component="sf_test" label="Shapiro-Francia Normality Test"/> - <entry component="shapiro_test" label="Shapiro-Wilk Normality Test"/> - <entry component="jb_test" label="Jarque-Bera Normality Test"/> + <entry component="ad_test" /> + <entry component="cvm_test" /> + <entry component="lillie_test" /> + <entry component="pearson_test" /> + <entry component="sf_test" /> + <entry component="shapiro_test" /> + <entry component="jb_test" /> </menu> <menu id="univariate_continuous_distributions" label="Univariate continuous distributions"> <menu id="beta_distribution" label="Beta"> - <entry component="beta_probabilities" label="Beta probabilities, quantiles, densities"/> - <entry component="plot_beta_clt" label="Beta CLT"/> - <entry component="plot_beta_distribution" label="Plot Beta distribution"/> + <entry component="beta_probabilities" /> + <entry component="plot_beta_clt" /> + <entry component="plot_beta_distribution" /> </menu> <menu id="cauchy_distribution" label="Cauchy"> - <entry component="cauchy_quantiles" label="Cauchy quantiles"/> - <entry component="cauchy_probabilities" label="Cauchy probabilities"/> - <entry component="plot_cauchy_distribution" label="Plot Cauchy distribution"/> + <entry component="cauchy_probabilities" /> + <entry component="plot_cauchy_distribution" /> </menu> <menu id="chi_squared_distribution" label="Chi-squared"> - <entry component="chi_squared_quantiles" label="Chi-squared quantiles"/> - <entry component="chi_squared_probabilities" label="Chi-squared probabilities"/> - <entry component="plot_chi_squared_clt" label="Chi-squared CLT"/> - <entry component="plot_chi_squared_distribution" label="Plot Chi-squared distribution"/> + <entry component="chi_squared_probabilities" /> + <entry component="plot_chi_squared_clt" /> + <entry component="plot_chi_squared_distribution" /> </menu> <menu id="exponential_distribution" label="Exponential"> - <entry component="exponential_quantiles" label="Exponential quantiles"/> - <entry component="exponential_probabilities" label="Exponential probabilities"/> - <entry component="plot_exponential_clt" label="Exponential CLT"/> - <entry component="plot_exponential_distribution" label="Plot Exponential distribution"/> + <entry component="exponential_probabilities" /> + <entry component="plot_exponential_clt" /> + <entry component="plot_exponential_distribution" /> </menu> <menu id="f_distribution" label="F"> - <entry component="f_quantiles" label="F quantiles"/> - <entry component="f_probabilities" label="F probabilities"/> - <entry component="plot_f_clt" label="F CLT"/> - <entry component="plot_f_distribution" label="Plot F distribution"/> + <entry component="f_probabilities" /> + <entry component="plot_f_clt" /> + <entry component="plot_f_distribution" /> </menu> <menu id="gamma_distribution" label="Gamma"> - <entry component="gamma_quantiles" label="Gamma quantiles"/> - <entry component="gamma_probabilities" label="Gamma probabilities"/> - <entry component="plot_gamma_clt" label="Gamma CLT"/> - <entry component="plot_gamma_distribution" label="Plot Gamma distribution"/> + <entry component="gamma_probabilities" /> + <entry component="plot_gamma_clt" /> + <entry component="plot_gamma_distribution" /> </menu> <menu id="gumbel_distribution" label="Gumbel"> - <entry component="gumbel_quantiles" label="Gumbel quantiles"/> - <entry component="gumbel_probabilities" label="Gumbel probabilities"/> + <entry component="gumbel_probabilities" /> </menu> <menu id="logistic_distribution" label="Logistic"> - <entry component="logistic_quantiles" label="Logistic quantiles"/> - <entry component="logistic_probabilities" label="Logistic probabilities"/> - <entry component="plot_logistic_clt" label="Logistic CLT"/> - <entry component="plot_logistic_distribution" label="Plot Logistic distribution"/> + <entry component="logistic_probabilities" /> + <entry component="plot_logistic_clt" /> + <entry component="plot_logistic_distribution" /> </menu> <menu id="log_normal_distribution" label="Log Normal"> - <entry component="log_normal_quantiles" label="Log Normal quantiles"/> - <entry component="log_normal_probabilities" label="Log Normal probabilities"/> - <entry component="plot_log_normal_clt" label="Log Normal CLT"/> - <entry component="plot_lognormal_distribution" label="Plot Lognormal distribution"/> + <entry component="log_normal_probabilities" /> + <entry component="plot_log_normal_clt" /> + <entry component="plot_lognormal_distribution" /> </menu> <menu id="normal_distribution" label="Normal"> - <entry component="normal_quantiles" label="Normal quantiles"/> - <entry component="normal_probabilities" label="Normal probabilities"/> - <entry component="plot_normal_clt" label="Normal CLT"/> - <entry component="plot_normal_distribution" label="Plot Normal distribution"/> + <entry component="normal_probabilities" /> + <entry component="plot_normal_clt" /> + <entry component="plot_normal_distribution" /> </menu> <menu id="tukey_distribution" label="Tukey"> - <entry component="tukey_probabilities" label="Tukey probabilities"/> - <entry component="tukey_quantiles" label="Tukey quantiles"/> - <entry component="plot_tukey_distribution" label="Plot Studentized Range (Tukey) distribution"/> + <entry component="tukey_probabilities" /> + <entry component="plot_tukey_distribution" /> </menu> <menu id="t_distribution" label="t"> - <entry component="t_quantiles" label="t quantiles"/> - <entry component="t_probabilities" label="t probabilities"/> - <entry component="plot_t_clt" label="t CLT"/> - <entry component="plot_t_distribution" label="Plot t distribution"/> + <entry component="t_probabilities" /> + <entry component="plot_t_clt" /> + <entry component="plot_t_distribution" /> </menu> <menu id="uniform_distribution" label="Uniform"> - <entry component="uniform_quantiles" label="Uniform quantiles"/> - <entry component="uniform_probabilities" label="Uniform probabilities"/> - <entry component="plot_uniform_clt" label="Uniform CLT"/> - <entry component="plot_uniform_distribution" label="Plot Uniform distribution"/> + <entry component="uniform_probabilities" /> + <entry component="plot_uniform_clt" /> + <entry component="plot_uniform_distribution" /> </menu> <menu id="weibull_distribution" label="Weibull"> - <entry component="weibull_quantiles" label="Weibull quantiles"/> - <entry component="weibull_probabilities" label="Weibull probabilities"/> - <entry component="plot_weibull_clt" label="Weibull CLT"/> - <entry component="plot_weibull_distribution" label="Plot Weibull distribution"/> + <entry component="weibull_probabilities" /> + <entry component="plot_weibull_clt" /> + <entry component="plot_weibull_distribution" /> </menu> </menu> <menu id="univariate_discrete_distributions" label="Univariate discrete distributions"> <menu id="binomial_distribution" label="Binomial"> - <entry component="binomial_probabilities" label="Binomial probabilities, quantiles, densities"/> - <entry component="plot_binomial_clt" label="Binomial CLT"/> - <entry component="plot_binomial_distribution" label="Plot binomial distribution"/> + <entry component="binomial_probabilities" /> + <entry component="plot_binomial_clt" /> + <entry component="plot_binomial_distribution" /> </menu> <menu id="geometric_distribution" label="Geometric"> - <entry component="geom_probabilities" label="Geometric probabilities"/> - <entry component="geom_quantiles" label="Geometric quantiles"/> - <entry component="plot_geometric_clt" label="Geometric CLT"/> - <entry component="plot_geometric_distribution" label="Plot Geometric distribution"/> + <entry component="geom_probabilities" /> + <entry component="plot_geometric_clt" /> + <entry component="plot_geometric_distribution" /> </menu> <menu id="hypergeometric_distribution" label="Hypergeometric"> - <entry component="hypergeometric_probabilities" label="Hypergeometric probabilities"/> - <entry component="hypergeometric_quantiles" label="Hypergeometric quantiles"/> - <entry component="plot_hypergeometric_clt" label="Hypergeometric CLT"/> - <entry component="plot_hypergeometric_distribution" label="Plot Hypergeometric distribution"/> + <entry component="hypergeometric_probabilities" /> + <entry component="plot_hypergeometric_clt" /> + <entry component="plot_hypergeometric_distribution" /> </menu> <menu id="negative_binomial_distribution" label="Negative Binomial"> - <entry component="negative_binomial_probabilities" label="Negative Binomial probabilities"/> - <entry component="negative_binomial_quantiles" label="Hypergeometric quantiles"/> - <entry component="plot_negbinomial_clt" label="Negative Binomial CLT"/> - <entry component="plot_negbinomial_distribution" label="Plot Negative Binomial distribution"/> + <entry component="negative_binomial_probabilities" /> + <entry component="plot_negbinomial_clt" /> + <entry component="plot_negbinomial_distribution" /> </menu> <menu id="poisson_distribution" label="Poisson"> - <entry component="poisson_probabilities" label="Poisson probabilities"/> - <entry component="poisson_quantiles" label="Poisson quantiles"/> - <entry component="plot_poisson_clt" label="Poisson CLT"/> - <entry component="plot_poisson_distribution" label="Plot Poisson distribution"/> + <entry component="poisson_probabilities" /> + <entry component="plot_poisson_clt" /> + <entry component="plot_poisson_distribution" /> </menu> <menu id="wilcoxon_distribution" label="Wilcoxon Rank Sum"> - <entry component="wilcoxon_quantiles" label="Wilcoxon Rank Sum quantiles"/> - <entry component="wilcoxon_probabilities" label="Wilcoxon Rank Sum probabilities"/> - <entry component="plot_wilcoxon_clt" label="Wilcoxon CLT"/> - <entry component="plot_wilcoxon_distribution" label="Plot Wilcoxon Rank Sum distribution"/> + <entry component="wilcoxon_probabilities" /> + <entry component="plot_wilcoxon_clt" /> + <entry component="plot_wilcoxon_distribution" /> </menu> </menu> </menu> diff --git a/rkward/plugins/distributions/beta.js b/rkward/plugins/distributions/beta.js index 1c6e0b8..209b8c1 100755 --- a/rkward/plugins/distributions/beta.js +++ b/rkward/plugins/distributions/beta.js @@ -1,9 +1,5 @@ include ("dist_common.js"); function getDistSpecifics () { - var dist = new Object; - dist["params"] = ', shape1=' + getValue ("shape1") + ', shape2=' + getValue ("shape2") + ', ncp=' + getValue ("ncp"); - dist["funstem"] = 'beta'; - dist["header"] = new Header (i18n ('Beta distribution')).addFromUI ("shape1").addFromUI ("shape2").addFromUI ("ncp"); - return dist; + return initDistSpecifics (i18n ('Beta distribution'), 'beta', ["shape1", "shape2", "ncp"], [0, 1], true); } diff --git a/rkward/plugins/distributions/beta.rkh b/rkward/plugins/distributions/beta.rkh new file mode 100644 index 0000000..66e3020 --- /dev/null +++ b/rkward/plugins/distributions/beta.rkh @@ -0,0 +1,22 @@ +<!DOCTYPE rkhelp> +<document> + <snippets> + <include file="dist_help_snippets.xml"/> + </snippets> + <summary> + Provides a calculator for probabilities, quantiles, and densities in the Beta distribution. + </summary> + <insert snippet="dialog_usage"/> + <settings> + <insert snippet="dialog_settings"/> + <setting id="shape1">Parameter of the Beta distribution</setting> + <setting id="shape2">Parameter of the Beta distribution</setting> + <setting id="ncp">Non-centrality parameter</setting> + </settings> + <related> + <ul> + <li><link href="rkward://rhelp/Beta"/></li> + <li><link href="rkward://component/rkward/plot_beta_distribution"/></li> + </ul> + </related> +</document> diff --git a/rkward/plugins/distributions/beta.xml b/rkward/plugins/distributions/beta.xml index 8b1d067..213111f 100755 --- a/rkward/plugins/distributions/beta.xml +++ b/rkward/plugins/distributions/beta.xml @@ -1,6 +1,7 @@ <!DOCTYPE rkplugin> <document> <code file="beta.js" /> + <help file="beta.rkh" /> <logic> <insert snippet="dialog_logic"/> </logic> @@ -12,7 +13,7 @@ </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Beta probabilities, quantiles, densities" > + <dialog label="Beta distribution calculator" > <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/binomial.js b/rkward/plugins/distributions/binomial.js index 7534c58..ca0f014 100644 --- a/rkward/plugins/distributions/binomial.js +++ b/rkward/plugins/distributions/binomial.js @@ -1,11 +1,6 @@ include ("dist_common.js"); function getDistSpecifics () { - var dist = new Object; - var size = getString ("size"); - dist["params"] = ', size=' + size + ", prob=" + getString ("prob"); - dist["funstem"] = 'binom'; - dist["max_quantile"] = size; - dist["header"] = new Header (i18n ('Binomial distribution')).addFromUI ("size").addFromUI ("prob"); + var dist = initDistSpecifics (i18n ('Binomial distribution'), 'binom', ["size", "prob"], [0, getString ("size")], false); return dist; } diff --git a/rkward/plugins/distributions/binomial.rkh b/rkward/plugins/distributions/binomial.rkh index 7afcc63..0b3d8ef 100644 --- a/rkward/plugins/distributions/binomial.rkh +++ b/rkward/plugins/distributions/binomial.rkh @@ -1,16 +1,14 @@ <!DOCTYPE rkhelp> <document> + <snippets> + <include file="dist_help_snippets.xml"/> + </snippets> <summary> Provides a calculator for probabilities, quantiles, and densities in the binonmial distribution. Note: For the binomial distribution, quantiles can be interpreted as number of successes in the given number of trials. </summary> - <usage> - Select the desired mode of operation, then specify the values of interest. - </usage> - <snippets> - <include file="dist_help_snippets.xml"/> - </snippets> + <insert snippet="dialog_usage"/> <settings> <insert snippet="dialog_settings"/> <setting id="size">Number of binomial trials</setting> diff --git a/rkward/plugins/distributions/cauchy.js b/rkward/plugins/distributions/cauchy.js new file mode 100755 index 0000000..66938ec --- /dev/null +++ b/rkward/plugins/distributions/cauchy.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('Cauchy distribution'), 'cauchy', ["location", "scale"]); +} diff --git a/rkward/plugins/distributions/cauchy.rkh b/rkward/plugins/distributions/cauchy.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/cauchy_probabilities.xml b/rkward/plugins/distributions/cauchy.xml similarity index 63% rename from rkward/plugins/distributions/cauchy_probabilities.xml rename to rkward/plugins/distributions/cauchy.xml index a257343..decb889 100755 --- a/rkward/plugins/distributions/cauchy_probabilities.xml +++ b/rkward/plugins/distributions/cauchy.xml @@ -1,6 +1,10 @@ <!DOCTYPE rkplugin> <document> - <code file="cauchy_probabilities.js" /> + <code file="cauchy.js" /> + <help file="cauchy.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" initial="0" id="location" label="Location"/> @@ -8,7 +12,7 @@ </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Cauchy probabilities" > - <insert snippet="probabilities_layout"/> + <dialog label="Cauchy distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/cauchy_probabilities.js b/rkward/plugins/distributions/cauchy_probabilities.js deleted file mode 100755 index 6d6f9db..0000000 --- a/rkward/plugins/distributions/cauchy_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pcauchy (q = ' + q + ', location = ' + getValue ("location") + ', scale = ' + getValue ("scale") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Cauchy probabilities", list ("Vector of quantiles", "' + q + '", "Location", "' + getValue ("location") + '", "Scale", "' + getValue ("scale") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Cauchy probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/cauchy_quantiles.js b/rkward/plugins/distributions/cauchy_quantiles.js deleted file mode 100755 index da16f15..0000000 --- a/rkward/plugins/distributions/cauchy_quantiles.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qcauchy (p = ' + p + ', location = ' + getValue ("location") + ', scale = ' + getValue ("scale") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Cauchy quantiles", list ("Vector of probabilities", "' + p + '", "Location", "' + getValue ("location") + '", "Scale", "' + getValue ("scale") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"));\n'); - echo ('rk.results (result, titles="Cauchy quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/cauchy_quantiles.xml b/rkward/plugins/distributions/cauchy_quantiles.xml deleted file mode 100755 index 32a47e3..0000000 --- a/rkward/plugins/distributions/cauchy_quantiles.xml +++ /dev/null @@ -1,14 +0,0 @@ -<!DOCTYPE rkplugin> -<document> - <code file="cauchy_quantiles.js" /> - <snippets> - <snippet id="dist_options"> - <spinbox default_precision="2" type="real" initial="0" id="location" label="Location"/> - <spinbox default_precision="2" type="real" min="0" initial="1" id="scale" label="Scale"/> - </snippet> - <include file="dist_snippets.xml"/> - </snippets> - <dialog label="Cauchy quantiles" > - <insert snippet="quantiles_layout"/> - </dialog> -</document> diff --git a/rkward/plugins/distributions/chi_squared.js b/rkward/plugins/distributions/chi_squared.js new file mode 100644 index 0000000..2ffd350 --- /dev/null +++ b/rkward/plugins/distributions/chi_squared.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('Chi-squared distribution'), 'chisq', ["df", "ncp"]); +} diff --git a/rkward/plugins/distributions/chi_squared.rkh b/rkward/plugins/distributions/chi_squared.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/chi_squared_quantiles.xml b/rkward/plugins/distributions/chi_squared.xml similarity index 63% rename from rkward/plugins/distributions/chi_squared_quantiles.xml rename to rkward/plugins/distributions/chi_squared.xml index 5d3845c..caf0688 100644 --- a/rkward/plugins/distributions/chi_squared_quantiles.xml +++ b/rkward/plugins/distributions/chi_squared.xml @@ -1,6 +1,10 @@ <!DOCTYPE rkplugin> <document> - <code file="chi_squared_quantiles.js" /> + <code file="chi_squared.js" /> + <help file="chi_squared.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" initial="1" id="df" min="0" label="Degrees of Freedom"/> @@ -8,7 +12,7 @@ </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Chi-squared quantile" > - <insert snippet="quantiles_layout"/> + <dialog label="Chi-squared distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/chi_squared_probabilities.js b/rkward/plugins/distributions/chi_squared_probabilities.js deleted file mode 100644 index cc0d9b1..0000000 --- a/rkward/plugins/distributions/chi_squared_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pchisq (q = ' + q + ', df = ' + getValue ("df") + ', ncp = ' + getValue ("ncp") + ', ' + getValue ("tail") + ', ' + getValue ("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Chi-squared probability", list ("Vector of quantiles", "' + q + '", "Degrees of Freedom", "' + getValue ("df") + '", "non-centrality parameter", "' + getValue ("ncp") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"));\n'); - echo ('rk.results (result, titles="Chi-squared probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/chi_squared_quantiles.js b/rkward/plugins/distributions/chi_squared_quantiles.js deleted file mode 100644 index 728d79e..0000000 --- a/rkward/plugins/distributions/chi_squared_quantiles.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qchisq (p = ' + p + ', df = ' + getValue ("df") + ', ncp = ' + getValue ("ncp") + ', ' + getValue ("tail") + ', ' + getValue ("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Chi-squared quantile", list ("Vector of probabilities", "' + p + '", "Degrees of freedom", "' + getValue ("df") + '", "non-centrality parameter", "' + getValue ("ncp") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"));\n'); - echo ('rk.results (result, titles="Chi-squared quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/dist_common.js b/rkward/plugins/distributions/dist_common.js index 7eaadef..2028932 100644 --- a/rkward/plugins/distributions/dist_common.js +++ b/rkward/plugins/distributions/dist_common.js @@ -4,6 +4,23 @@ var dist; var invar; var outvar; +function initDistSpecifics (title, stem, params, range, continuous) { + var dist = new Object (); + var header = new Header (title); + var par = ""; + for (var i = 0; i < params.length; ++i) { + header.addFromUI (params[i]); + par += ', ' + params[i] + '=' + getString (params[i]); + } + dist["header"] = header; + dist["params"] = par; + dist["funstem"] = stem; + dist["min"] = Number (range[0]); + dist["max"] = Number (range[1]); + dist["cont"] = continuous; + return dist; +} + function calculate () { mode = getString ("mode"); dist = getDistSpecifics (); @@ -31,15 +48,15 @@ function calculate () { var max_auto_sequence_length = 20; if (invar == 'q') { - var maxquant = dist["max_quantile"]; - if (typeof (maxquant) != 'undefined') { - if (maxquant <= max_auto_sequence_length) { - values = '0:' + String (maxquant); + if (!dist["cont"]) { + var span = dist["max"] - dist["min"]; + if (span <= max_auto_sequence_length) { + values = String (dist["min"]) + ':' + String (dist["max"]); } else { - values = 'seq.int (0, ' + String (maxquant) + ', by=' + String (Math.ceil (maxquant / max_auto_sequence_length)) + ')'; + values = 'seq.int (' + String (dist["min"]) + ', ' + String (dist["max"]) + ', by=' + String (Math.ceil (span / max_auto_sequence_length)) + ')'; } } else { - values = 'seq (0, 1, length.out=' + String (max_auto_sequence_length+1) + ')'; + values = 'seq (' + String (dist["min"]) + ', ' + String (dist["max"]) + ', length.out=' + String (max_auto_sequence_length+1) + ')'; } } else { // invar == 'p' if (logpd) { diff --git a/rkward/plugins/distributions/dist_help_snippets.xml b/rkward/plugins/distributions/dist_help_snippets.xml index 43f4ef1..c4736c9 100644 --- a/rkward/plugins/distributions/dist_help_snippets.xml +++ b/rkward/plugins/distributions/dist_help_snippets.xml @@ -9,4 +9,7 @@ <setting id="lower">If checked (the default) probabilities are P[X ≤ x]. Otherwise (upper tail) probabilities are P[X > x]</setting> <caption title="Distribution specific settings"/> </snippet> + <snippet id="dialog_usage"> + <usage>Select the desired mode of operation, then specify the values of interest. The input values (quantiles or probabilies) can be left empty, in which case a short sequence of evenly spaced values will be filled in, automatically.</usage> + </snippet> </document> diff --git a/rkward/plugins/distributions/exponential.js b/rkward/plugins/distributions/exponential.js new file mode 100755 index 0000000..22f8660 --- /dev/null +++ b/rkward/plugins/distributions/exponential.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('Exponential distribution'), 'exp', ["rate"]); +} diff --git a/rkward/plugins/distributions/exponential.rkh b/rkward/plugins/distributions/exponential.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/exponential_probabilities.xml b/rkward/plugins/distributions/exponential.xml similarity index 55% rename from rkward/plugins/distributions/exponential_probabilities.xml rename to rkward/plugins/distributions/exponential.xml index efee93c..cec6009 100755 --- a/rkward/plugins/distributions/exponential_probabilities.xml +++ b/rkward/plugins/distributions/exponential.xml @@ -1,13 +1,17 @@ <!DOCTYPE rkplugin> <document> - <code file="exponential_probabilities.js" /> + <code file="exponential.js" /> + <help file="exponential.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" min="0" initial="1" id="rate" label="vector of rates"/> </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Exponential probabilities" > - <insert snippet="probabilities_layout"/> + <dialog label="Exponential distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/exponential_probabilities.js b/rkward/plugins/distributions/exponential_probabilities.js deleted file mode 100755 index d985514..0000000 --- a/rkward/plugins/distributions/exponential_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pexp (q = ' + q + ', rate = ' + getValue ("rate") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Exponential probabilities", list ("Vector of quantiles", "' + q + '", "Rate", "' + getValue ("rate") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Exponential probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/exponential_quantiles.js b/rkward/plugins/distributions/exponential_quantiles.js deleted file mode 100755 index 8c2a09e..0000000 --- a/rkward/plugins/distributions/exponential_quantiles.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qexp (p = ' + p + ', rate = ' + getValue ("rate") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Exponential quantiles", list ("Vector of probabilities", "' + p + '", "Rate", "' + getValue ("rate") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Exponential quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/exponential_quantiles.xml b/rkward/plugins/distributions/exponential_quantiles.xml deleted file mode 100755 index 0b76e69..0000000 --- a/rkward/plugins/distributions/exponential_quantiles.xml +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE rkplugin> -<document> - <code file="exponential_quantiles.js" /> - <snippets> - <snippet id="dist_options"> - <spinbox default_precision="2" type="real" min="0" initial="1" id="rate" label="vector of rates"/> - </snippet> - <include file="dist_snippets.xml"/> - </snippets> - <dialog label="Exponential quantiles" > - <insert snippet="quantiles_layout"/> - </dialog> -</document> diff --git a/rkward/plugins/distributions/f.js b/rkward/plugins/distributions/f.js new file mode 100644 index 0000000..b148eae --- /dev/null +++ b/rkward/plugins/distributions/f.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('F distribution'), 'f', ["df1", "df2", "ncp"]); +} diff --git a/rkward/plugins/distributions/f.rkh b/rkward/plugins/distributions/f.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/f_probabilities.xml b/rkward/plugins/distributions/f.xml similarity index 73% rename from rkward/plugins/distributions/f_probabilities.xml rename to rkward/plugins/distributions/f.xml index 54dbadd..ee0e96a 100644 --- a/rkward/plugins/distributions/f_probabilities.xml +++ b/rkward/plugins/distributions/f.xml @@ -1,6 +1,10 @@ <!DOCTYPE rkplugin> <document> - <code file="f_probabilities.js" /> + <code file="f.js" /> + <help file="f.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" initial="1" id="df1" min="0" label="Numerator degree of Freedom"/> @@ -9,7 +13,7 @@ </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="F probability" > - <insert snippet="probabilities_layout"/> + <dialog label="F distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/f_probabilities.js b/rkward/plugins/distributions/f_probabilities.js deleted file mode 100644 index 7c47415..0000000 --- a/rkward/plugins/distributions/f_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pf (q = ' + q + ', df1 = ' + getValue ("df1") + ', df2 = ' + getValue ("df2") + ', ncp = ' + getValue ("ncp") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("F probability", list ("Vector of quantiles", "' + q + '", "Numerator degrees of freedom", "' + getValue ("df1") + '", "Denominator degrees of freedom", "' + getValue ("df2") + '", "non-centrality parameter", "' + getValue ("ncp") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"));\n'); - echo ('rk.results (result, titles="F probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/f_quantiles.js b/rkward/plugins/distributions/f_quantiles.js deleted file mode 100644 index d26c733..0000000 --- a/rkward/plugins/distributions/f_quantiles.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qf (p = ' + p + ', df1 = ' + getValue ("df1") + ', df2 = ' + getValue ("df2") + ', ncp = ' + getValue ("ncp") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("F quantile", list ("Vector of probabilities", "' + p + '", "Numerator degrees of freedom", "' + getValue ("df1") + '", "Denominator degrees of freedom", "' + getValue ("df2") + '", "non-centrality parameter", "' + getValue ("ncp") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"));\n'); - echo ('rk.results (result, titles="F quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/f_quantiles.xml b/rkward/plugins/distributions/f_quantiles.xml deleted file mode 100644 index 753db1b..0000000 --- a/rkward/plugins/distributions/f_quantiles.xml +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE rkplugin> -<document> - <code file="f_quantiles.js" /> - <snippets> - <snippet id="dist_options"> - <spinbox default_precision="2" type="real" initial="1" id="df1" min="0" label="Numerator degree of Freedom"/> - <spinbox default_precision="2" type="real" initial="1" id="df2" min="0" label="Denominator degree of Freedom"/> - <spinbox default_precision="2" type="real" initial="0" id="ncp" min="0" label="non-centrality parameter"/> - </snippet> - <include file="dist_snippets.xml"/> - </snippets> - <dialog label="F quantile" > - <insert snippet="quantiles_layout"/> - </dialog> -</document> diff --git a/rkward/plugins/distributions/gamma.js b/rkward/plugins/distributions/gamma.js new file mode 100755 index 0000000..b7dabe1 --- /dev/null +++ b/rkward/plugins/distributions/gamma.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('Gamma distribution'), 'gamma', ["shape", "rate"]); +} diff --git a/rkward/plugins/distributions/gamma.rkh b/rkward/plugins/distributions/gamma.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/gamma_probabilities.xml b/rkward/plugins/distributions/gamma.xml similarity index 64% rename from rkward/plugins/distributions/gamma_probabilities.xml rename to rkward/plugins/distributions/gamma.xml index d186b9c..c5d3288 100755 --- a/rkward/plugins/distributions/gamma_probabilities.xml +++ b/rkward/plugins/distributions/gamma.xml @@ -1,6 +1,10 @@ <!DOCTYPE rkplugin> <document> - <code file="gamma_probabilities.js" /> + <code file="gamma.js" /> + <help file="gamma.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" min="0" initial="1" id="shape" label="Shape"/> @@ -8,7 +12,7 @@ </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Gamma probabilities" > - <insert snippet="probabilities_layout"/> + <dialog label="Gamma distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/gamma_probabilities.js b/rkward/plugins/distributions/gamma_probabilities.js deleted file mode 100755 index 7592643..0000000 --- a/rkward/plugins/distributions/gamma_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pgamma (q = ' + q + ', shape = ' + getValue ("shape") + ', rate = ' + getValue ("rate") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Gamma probability", list ("Vector of quantiles", "' + q + '", "Shape", "' + getValue ("shape") + '", "Rate", "' + getValue ("rate") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Gamma probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/gamma_quantiles.js b/rkward/plugins/distributions/gamma_quantiles.js deleted file mode 100755 index a00570c..0000000 --- a/rkward/plugins/distributions/gamma_quantiles.js +++ /dev/null @@ -1,15 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qgamma (p = ' + p + ', shape = ' + getValue ("shape") + ', rate = ' + getValue ("rate") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); - echo ('\n'); -} - -function printout () { - echo ('rk.header ("Gamma quantile", list ("Vector of probabilities", "' + p + '", "Shape", "' + getValue ("shape") + '", "Rate", "' + getValue ("rate") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Gamma quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/gamma_quantiles.xml b/rkward/plugins/distributions/gamma_quantiles.xml deleted file mode 100755 index bd06aa2..0000000 --- a/rkward/plugins/distributions/gamma_quantiles.xml +++ /dev/null @@ -1,14 +0,0 @@ -<!DOCTYPE rkplugin> -<document> - <code file="gamma_quantiles.js" /> - <snippets> - <snippet id="dist_options"> - <spinbox default_precision="2" type="real" min="0" initial="1" id="shape" label="Shape"/> - <spinbox default_precision="2" type="real" min="0" initial="1" id="rate" label="Rate"/> - </snippet> - <include file="dist_snippets.xml"/> - </snippets> - <dialog label="Gamma quantiles" > - <insert snippet="quantiles_layout"/> - </dialog> -</document> diff --git a/rkward/plugins/distributions/geom.js b/rkward/plugins/distributions/geom.js new file mode 100755 index 0000000..0c4a02f --- /dev/null +++ b/rkward/plugins/distributions/geom.js @@ -0,0 +1,5 @@ +include ("dist_common.js"); + +function getDistSpecifics () { + return initDistSpecifics (i18n ('Geometric distribution'), 'geom', ["prob"]); +} diff --git a/rkward/plugins/distributions/geom.rkh b/rkward/plugins/distributions/geom.rkh new file mode 100644 index 0000000..e69de29 diff --git a/rkward/plugins/distributions/geom_probabilities.xml b/rkward/plugins/distributions/geom.xml similarity index 60% rename from rkward/plugins/distributions/geom_probabilities.xml rename to rkward/plugins/distributions/geom.xml index 2f821d8..bd3564b 100755 --- a/rkward/plugins/distributions/geom_probabilities.xml +++ b/rkward/plugins/distributions/geom.xml @@ -1,13 +1,17 @@ <!DOCTYPE rkplugin> <document> - <code file="geom_probabilities.js" /> + <code file="geom.js" /> + <help file="geom.rkh" /> + <logic> + <insert snippet="dialog_logic"/> + </logic> <snippets> <snippet id="dist_options"> <spinbox default_precision="2" type="real" min="0" initial="0.5" max="1" id="prob" label="probability of success in each trial"/> </snippet> <include file="dist_snippets.xml"/> </snippets> - <dialog label="Geometric probabilities" > - <insert snippet="probabilities_layout"/> + <dialog label="Geometric distribution calculator" > + <insert snippet="dialog_layout"/> </dialog> </document> diff --git a/rkward/plugins/distributions/geom_probabilities.js b/rkward/plugins/distributions/geom_probabilities.js deleted file mode 100755 index d020dd6..0000000 --- a/rkward/plugins/distributions/geom_probabilities.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var q; - -function calculate () { - q = "c (" + getString ("q").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (pgeom (q = ' + q + ', prob = ' + getValue ("prob") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Geometric probability", list ("Vector of quantiles", "' + q + '", "Probability of success in each trial", "' + getValue ("prob") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Geometric probabilities")\n'); -} - diff --git a/rkward/plugins/distributions/geom_quantiles.js b/rkward/plugins/distributions/geom_quantiles.js deleted file mode 100755 index 52c1aa8..0000000 --- a/rkward/plugins/distributions/geom_quantiles.js +++ /dev/null @@ -1,14 +0,0 @@ -// globals -var p; - -function calculate () { - p = "c (" + getString ("p").replace (/[, ]+/g, ", ") + ")"; - - echo ('result <- (qgeom (p = ' + p + ', prob = ' + getValue ("prob") + ', ' + getValue ("tail") + ', ' + getValue("logp") + '))\n'); -} - -function printout () { - echo ('rk.header ("Geometric quantile", list ("Vector of probabilities", "' + p + '", "Probability of success in each trial", "' + getValue ("prob") + '", "Tail", "' + getValue ("tail") + '", "Probabilities p are given as", "' + getValue ("logp") + '"))\n'); - echo ('rk.results (result, titles="Geometric quantiles")\n'); -} - diff --git a/rkward/plugins/distributions/geom_quantiles.xml b/rkward/plugins/distributions/geom_quantiles.xml deleted file mode 100755 index 27c7dcb..0000000 --- a/rkward/plugins/distributions/geom_quantiles.xml +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE rkplugin> -<document> - <code file="geom_quantiles.js" /> - <snippets> - <snippet id="dist_options"> - <spinbox default_precision="2" type="real" min="0" initial="0.5" max="1" id="prob" label="probability of success in each trial"/> - </snippet> - <include file="dist_snippets.xml"/> - </snippets> - <dialog label="Geometr... [truncated message content] |