# Tagged Questions

58 views

### Compute a probability using stochastic simulation

My problem is to solve the following optimisation problem using GA (Genetic Algorithm)and stochastic simulation. The goal is to solve the maximisation problem : \begin{equation*} \begin{aligned} ...
26 views

### Substitution test for ANOVA?

I am working on biological dataset. Around 20000 genes of each sample are comparing with the same ones in another group in order to find significantly differentially expressed genes. I am comparing 3 ...
29 views

### Compute the inverse of function [closed]

I want to compute and plot the inverse of given function f. I have the following code in R : ...
48 views

### kde.test gives different p-values for similar KDEs

I have 4 sets of random floats between [0,1]: $d1, d2, d3, d4$. I need to compare these sets by pairs and I make use of the kde.test function of R's ...
60 views

### How to write log-likelihood for beta-geometric with optim() in R?

I am trying to estimate the parameters for a shifted beta-geometric distribution to model user churn, as shown in this paper. The log-likelihood function is described there and solved via Excel, and I ...
49 views

### Generating random variable from density function

How can I generate a random variable of size n= 2914 if I have the density function?. So the problem is that I have the density f(x) (function well defined) ...
147 views

### Probability that a draw from one sample is greater than a draw from a another sample

I have a sample of b for id=1 and I want to compare this sample with the sample of id={2,3} of a i.e. I want to compute the ...
61 views

### General Statistics Problem: Identifying trends in data

I apologize in advance if this question is overly general. I have a practical solution, which isn't very elegant, and having only a little bit of experience with statistics, am hoping for general ...
60 views

### Distribution of correlation coefficient between two discrete random variables and their collapsed form

I have two discrete random variables with PMF of the form \begin{align*} P(X) = \begin{cases} p_0, & \mbox{if } X=0 \\ p_1, & \mbox{if } X=1 \\ p_2, & ...
88 views

### Equi-probable sampling in R using the prob argument in sample()?

If I have data of length n and want to generate a random sample of length N, does the following use of the ...
151 views

### Symmetrised Kullback - Leibler divergence

I have trouble understanding KL divergence, where P is probability mass function of true distribution of data and Q is the approximation of P. The definition of KL divergence is: ...
115 views

### Cumulative predicted probabilities in logistic regression

I'm analyzing users' in-game data in order to model whether they're going to be paid user or not. Here's my model: ...
97 views

### Fitting distributions in R

I hope you are very well. I have a big dataset (~9 million registries) and I have 2 variables $X$=purchase amount and $Y$=frequency of purchase. I would like to know what distribution should I use for ...
150 views

### Fitting copulas with a given covariance matrix

Suppose that I have a new way of estimating covariance matrice (from a particular data set), and that I believe this is better than the sample covariance matrix. I want to fit a t-copula with this new ...
125 views

### How to compute HDR probability level for Highest density regions estimates

In the R package hdrcde by Rob Hyndman for Computation of highest density regions in one and two dimensions, the hdrbw function ...
90 views

### A model that can fit binary data in R

I have data that indicates if the computers in my network are up or down. Data is collected every minute and has a seasonality of one week, looks like this for 3 hosts. Servers are supposed to go down ...
97 views

### Regression and point-specific p-values (using R for explanation)

Consider the following (in R): library(MASS) plot(stack.loss~Air.Flow,data=stackloss) regression <- rlm(stack.loss~Air.Flow,data=stackloss) abline(regression) ...
84 views

### Estimating the probability of next failure?

I have some data about how some components failed. They can either be replaced in whole or have some of their sub-components repaired. I would like to know if there is a way to fit a failure model to ...
152 views

### How to calculate the log likelihood in HMM from the output of the forward algorithm in R?

How can I get the log likelihood or the probability value from the forward algorithm for an observed sequence? For example, when I executed the forward algorithm in ...
66 views

### Expected peak to trough calculation

I am having trouble coding up in R equation 3.1 in the following paper: http://www.intelligenthedgefundinvesting.com/pubs/rb-cb.pdf My function: ...
85 views

### Z test of coefficients of output?

I have fitted a certain ARMA model and got the following output: As you can see, some coeff were set to zero and the focus is on the ma5 coeff and the intercept. To be exactly, the ma5 coeff is ...
47 views

### Is there a function to check a set of events/random variables are mutually independent?

Say, 5 random variables A,B,C,D,E which can take values either 0 or 1. I have the theoretical population chances for the 32 cases of P(A,B,C,D,E). Obviously they add up to 1. How to check if ...
402 views

### Using R for dice probabilities

Using R, what function(s) would I use to obtain the following probabilities? Roll at least one 1 when rolling 2 six-sided dice (2d6) = 11/36 Roll at least one 1 when rolling 3 six-sided dice (3d6) ...
197 views

### Overlapping sets (3) - significance test

Sorry if this appears to be a naive question! I have three overlapping sets and I want to find the probability of finding a larger/greater intersection for 'A intersect B intersect C' (in the example ...
65 views

### Probability distribution for varying probabilities in R [duplicate]

I'd like to plot the probability distribution for a set of binomial trials in R, the catch is that each trial has an independent probability of success (which I have in vector form). So, in R if I ...
149 views

### How to calculate the probability of absence for a certain category of artefacts from a sample, given prior knowledge about its abundance?

In archaeology, artefacts are commonly classified in categories according to certain criteria (those may include manufacturing technique, decoration, function, chronology, etc). I am trying to ...
191 views

### Suppose that $R^2=0$ . Does this imply that Y and X are unrelated? [duplicate]

Possible Duplicate: Under what conditions does correlation imply causation? Can somebody illustrate how there can be dependence and zero covariance? Or could there still be a ...
248 views

### Build a path probability tree for journeys through a website

I'm currently doing analysis on a website which requires that I create a decision tree diagram showing the likely route that people take whenever they arrive on the website. I am dealing with a ...
51 views

### When to use the raw dataset as opposed to a transformed dataset for computing divergence?

Let us assume I have a set of observations: Dataset 1: Raw $A = [a_1,a_2,a_3,a_4,...]$ $B = [b_1,b_2,b_3,b_4,...]$ One assumptions before I proceed: Range of the values that the random variable ...
286 views

### K-L divergence is 0 for clearly different distributions. Why?

I have two datasets whose densities look clearly different. However, when I use the KLdiv function, it gives me a value of 0 and I don't understand why. Any suggestions on where I am going wrong? ...
204 views

...
136 views

### prior distribution to the binomial distribution probability distributions urn model

I have an infinite population with unknown mean of successes and failures. I'm drawing 400 times from the population and get 400 successes. Now I want to generate random estimates for the true mean of ...
536 views

### Methods & CRAN packages to predict probability using neural networks or others machine learning algorithms

I have a medical database containing 7 input variables (4 are binary) and a binary outcome variable (Survival: yes/no). My objective is to train and test an algorithm that predict probability of ...
309 views

### Logistic regression-like model for non-discrete outcomes

If I have a set of continuous predictors $X$ and a binary outcome $Y$ and I wanted to build a predictive model of $P(Y|X)$, I would start with a logistic regression model. However, in my particular ...
124 views

### probability of interest

The model that I created in R is: fit <- lm(hired ~ educ + exper + sex, data=data) what I am unsure of is how to fit to model to predict probability of interest where p = pr(hiring = 1). Any ...
74 views

### Generating non-zero binomial probabilities (n,k ) with small p and large n - k

I am trying to generate binomial probabilities (in R) as follows: ${N \choose{k}} p^{k} (1-p)^{(n-k)}$ My problem is given $p \approx 0.03$, and $N =400$, $k>270$, I get the probability equal to ...
95 views

### How to produce a vector based on two probability distributions?

I am working on distribution on plants and I need to enter the chances that a plant starts reproducing at a certain age in a vector. Only this has to be done for more generations. Now, Imagine I ...
168 views

### Risk of extinction of Schrödinger's cats

I am interested in how uncertainty can be accounted for when considering the risk of extinction of a species. Forgive me for extending a rather tired thought experiment, but at least it's familiar ...
24 views

### dirichlet density function returning values > 1.0 [duplicate]

Possible Duplicate: Probability distribution value exceeding 1 is OK? I'm comparing results given by this implementation and that from the gtool library in R, of the Dirichlet density ...
557 views

### Optimal software package for bayesian analysis

I was wondering which software statistical package do you guys recommend for performing Bayesian Inference. For example, I know that you can run openBUGS or winBUGS as standalones or you can also ...
396 views

### Bootstrapping and comparing multiple proportions

EDIT 1: Thanks to @gung for pointing out that if the bag initially had 324 sweets, then as Mother hands them out, there are consecutively fewer amounts she can hand out. To simplify things (because ...
1k views

### Graphing a Probability Curve for a Logit Model With Multiple Predictors

I have the following probability function: $$\text{Prob} = \frac{1}{1 + e^{-z}}$$ where $$z = B_0 + B_1X_1 + \dots + B_nX_n.$$ My model looks like \Pr(Y=1) = \frac{1}{1 + \exp\left(-[-3.92 + ...
900 views

### How to interpret the results of the R pnorm and analogous functions?

The help for the pnorm function states: It says that pnorm gives the "distribution function", but it seems that it gives the quantile, for example, ...
820 views

### How to assess predictive power of set of categorical predictors of a binary outcome? Calculate probabilities or logistic regression?

I am trying to determine if simple probabilities will work for my problem or if it will be better to use (and learn about) more sophisticated methods like logistic regression. The response variable ...
699 views

### Simulating a Gaussian process with an exponentially decaying covariance function

I'm trying to generate many draws (i.e., realizations) of a Gaussian process $e_i(t)$, $1\leq t \leq T$ with mean 0 and covariance function $\gamma(s,t)=\exp(-|t-s|)$. Is there an efficient way ...
135 views

### Hypergeometric trials - Number of trials needed to achieve a given probability

Given a known number of white and black balls in an urn, what is the number of trials without replacement required to achieve a given x probability of drawing at least one white ball. Which function ...
592 views

### Binomial trials required to achieve a given probability of at least one success

If p is the probability of success of a binomial trial i would like to calculate the number of trials n required that if performed would give a probability x of at least one success. Is there a way to ...
63 views

### Cost Benefit/Effectiveness

I would like to compare the results of several diagnostic modalities on a population to identify a disease. More specifically I would like to compare the sensitivity of the modalities (all have 100% ...