Using (pseudo-)random numbers to simulate the random behavior of a real system.

learn more… | top users | synonyms

1
vote
0answers
10 views

Monte-Carlo: R script not returning anything [migrated]

My R script is mcnorm.R <- function(M,N) { library("mvtnorm", lib.loc="~/R/win-library/3.2") R <- as.matrix(read.csv("Data.csv", header=FALSE)) mu <- colMeans(R) ...
2
votes
0answers
30 views

Are Latin hypercube samples uncorrelated

I understand the basics to Latin hypercube sampling, such as implemented by the algorithm LHSA mentioned in the book Design and Modeling for Computer Experiments. But I'd like to make sure: 1, n ...
3
votes
1answer
18 views

Variance Reduction calculate

If $\phi(x)=\frac{e^x-1}{e-1}I_{[0,1]}(x)$, use the variance reduction techniques: Importance Sampling, Antithetic Variables, Control Variates.Compare the methods and check which provides the greatest ...
0
votes
0answers
35 views

Monte Carlo Integration, Importance Sampling

Suppose I want to apply Importance Sampling in the following integral $$\int_X h(x)f(x)dx=\int_X h(x)\frac{f(x)}{g(x)}g(x)dx$$ where $f(x)$ is a probability density function, so I need another ...
1
vote
0answers
8 views

Power of a case control test as a function of P(X=1) & P(Y=1)

For our course in statistics we had to build a simulation which would give insight in the power of a case-control study vs that of a cohort study, both trying to discover an association between 2 ...
-1
votes
0answers
12 views

sampling from distribution [duplicate]

In Monte Carlo Markov chain (Gibbs or Metropolis-hastings) samples are drawn from posterior distribution. In layman terms, how sampling is done from a distribution?
3
votes
1answer
44 views

Control Variates, Monte Carlo integration

Exercise: Calculate $P(N>2.5)$ where $N$~$N(0,1)$ through simple monte carlo integration, and then use control variables to reduce the variance of my estimator. I did ...
4
votes
1answer
102 views

Variance reduction technique in Monte Carlo integration

I have some trouble understanding the variance reduction method called "Antithetic variables": Suppose that the integrand is $g(x)=x^2$ and the reference density $f(x)=e^{-x}I_{[0,\infty]}$ is ...
0
votes
1answer
26 views

Proof of Marsaglia polar method

I studied Polar method and I can use it very well to simulate to Standard Normal Variable. But I can't figure it out that how it works! So is there any proof/theorem to learn reasoning behind Polar ...
3
votes
2answers
39 views

Strategy for geometric die guessing game

The first day of statistics class, we played a betting game to visualize the basics of probability distributions. It worked like this: The teacher begins by rolling a die repeatedly until the number ...
2
votes
1answer
31 views

How to run Chisq independence test using monte carlo method

I've been investigating exact tests and during that I find monte carlo method very useful. I can write my own code for randomization and permutation tests but I cannot figure out how R function ...
2
votes
0answers
20 views

After Monte Carlo simulations, should I do multiple test correction?

I performed Monte Carol simulation to assess the significance of a certain motif in genome DNA. I also carried out hundred different motifs using the same procedure. So I got a bunch of p-values for ...
1
vote
0answers
41 views

Combining variance reduction techniques

I'm looking for some reference on the combination of various variance reduction techniques, in particular a best linear unbiased estimator. The only reference I have is McLeish - Monte Carlo ...
0
votes
0answers
27 views

Bayesian Monte Carlo modeling and selecting priors [duplicate]

Could anyone recommend some not-too-mathy introductory texts to Bayesian regression and Monte Carlo modeling? I am neither a statistician nor an econometrician. The frequentist perspective makes ...
1
vote
0answers
18 views

Monte Carlo integration and reweighting

I have to find the expectation of a particular function, $f(x)$ with respect to a gamma distribution $Ga(a_k,b_k)$. However, at each iteration $k$, the gamma parameters $a_k,b_k$ change. Suppose ...
2
votes
1answer
42 views

Monte-Carlo integration

Calculate $\int_1^2 cx^2e^xdx$ where c is constant $f(x)=ce^x, x\in[1,2]$ $\phi(x)=x^2 $ i)Using Monte-Carlo integration ii) Using antagonistic variables I do not know how to do this, as in the ...
1
vote
1answer
33 views

Predicting value over time

I'm trying to predict the value of a variable after a specified number of days. I'm assuming it will change each day by a normally distributed random amount. For example, today the value is 10. Over ...
0
votes
0answers
40 views

How do I sample from a black-box model of a probability distribution?

I have a function 'P(x)' where we query for any 'x' it gives a probability value. This function 'P' does not have a closed form and the evaluation is costly. Now 'x' is a set of vectors(matrix whose ...
3
votes
1answer
40 views

Gibbs Sampler - Sample mean convergence

To simulate from the posterior distribution $p(\theta|Y)$ where $\theta = (\mu,\lambda_1,\lambda_2)$, I run a Gibbs sampler to draw approximately random values from $p(\theta|Y)$. This Gibbs sampler ...
0
votes
0answers
10 views

'invalid file specification' when running Monte Carlo simulation [migrated]

I programmed the monte carlo simulation down below. The simulation itself works, but I do not seem able to summarize it. When I run my full program, the do file automatically ends after the monte ...
0
votes
0answers
17 views

Using the terms significance, probability or likelihood, in connection with estimators

Imagine a number of variates $x_i$, and a number of processes $P_k$ which depend on these variables, in an unknown way (ie no clear cut formulas to work with). Now consider the scenario where you ...
0
votes
0answers
17 views

Algorithm calculating the autocorrelation time

I am in the middle of the analysis of a large set of Monte-Carlo data and you may know that calculating the autocorrelation of the Chain is a good part of the error estimation. I am doing this error ...
0
votes
0answers
14 views

Better approach to determining parameter error bars than my Monte Carlo approach?

I have a certain astrophysical phenomenon currently described by a few different models. For a given model I can expect a certain number of particles passing by earth as a function of time. From this ...
0
votes
1answer
63 views

Gibbs Sampler Running Wild

So, I'm setting up a Gibbs Sampler using a multivariate normal model with a Jeffreys prior (working through the Hoff book on my own). There's also missing data to be imputed. I've checked my posterior ...
0
votes
0answers
24 views

Montecarlo analysis: how many iterations I need?

I am working on a Montecarlo analysis. I have a transfer function from R^m-->R (i.e. m inputs to one single output), whose I do not know deterministically the m inputs. So I generate N random values ...
2
votes
1answer
40 views

Simulated chi-square distribution doesn't match theoretical

Can someone explain why the distribution of Chi-square values I'm getting (using Pearson goodness-of-fit test) doesn't match the expected Chi-sqaure distribution? The test seems in this case to be ...
0
votes
1answer
51 views

Bootstrap and MonteCarlo Method

I am trying to make sense of the bootstrap method. I am studying on Rice, "mathematical statistics and data analysis" Here it is its explanation of the bootstrap method: Imagine for the moment ...
2
votes
1answer
25 views

Adjusting Monte Carlo estimates to generate correct even moments - improving on antitthetic draws

If I want to generate a matrix 10,000 (row) samples of 3 uniform (uncorrelated) variables it is trivial to use antithetic draws to ensure the odd moments such as the mean equal their "true" value. ...
0
votes
0answers
37 views

Bootstrap resampling for constructing hypothesis test

I need to use bootstrap resampling to test the significant difference between two datasets (data1 & data2). I have already used bootstrap resampling to estimate the confidence interval of the mean ...
1
vote
0answers
39 views

Confidence intervals for sample mean when estimated standard deviation is 0

I ran a Monte Carlo simulation to determine a confidence interval for the population mean based on N trials. The underlying distribution of results is not normal (the values are discrete -- 0, .5 or ...
0
votes
0answers
41 views

Can you perform bootstrap resampling from a sampling distribution?

The quick and to-the-point question I have is: Can you perform bootstrap resampling on a sampling distribution, using the sampling distribution as if it were an original sample of observations? What ...
0
votes
0answers
12 views

Do the number of entries per bin of a histogram obtained out of a try and reject sampling of a pdf follow a Poisson distribution?

Imagine we have this pdf $\frac{3}{8}(1+x^2)+0.017x$ defined in $x\in[-1,1]$. Imagine we make a try and reject sampling and get many values of $x$. Imagine that with this variables we make a ...
2
votes
1answer
59 views

Get distribution for aggregate loss using Monte Carlo

I am given two data sets containing dates and losses (in some currency). Given a distribution for the amount of losses and an (a,b,0) distribution for frequency of losses, how can I use Monte Carlo ...
0
votes
1answer
40 views

bivariate normal distribution probability

We have two genes X and Y. Let $(X,Y)\sim N(\mu_x=9,\mu_y=10,\sigma^2_x=3,\sigma^2_y=5,\rho\sigma_x\sigma_y=2)$. To find $P(X+0.5<Y)$ the probability that the sample mean for the second gene ...
8
votes
1answer
474 views

Does Monte Carlo == apply a random process?

I never had a formal statistics course but due to my line of research I'm constantly coming across articles which apply several statistical concepts. Often I'll see a description of a Monte Carlo ...
3
votes
1answer
81 views

Estimating quantiles by simulation

I'm a bit confused about how I would go about estimating quantiles by simulation. Say I have some statistical model $f(x,\theta)$. I can estimate the parameter $\theta$ and am able to generate random ...
1
vote
0answers
39 views

How can I sample multivariate binary variables such that sum of them follows a gamma distribution?

Edit: Since the original question was confusing as whuber pointed out, let me rephrase the question with a Poisson distribution instead of a gamma distribution. The energy term of a Poisson ...
4
votes
1answer
376 views

How to create a toy survival (time to event) data with right censoring

I wish to create a toy survival (time to event) data which is right censored and follows some distribution with proportional hazards and constant baseline hazard. I created the data as follows, but I ...
3
votes
1answer
72 views

Residual based bootstrap autoregressive series in MATLAB

I have defined the model as follows. Let $$y_1 = 0$$ and $$ y_i = \alpha + \beta y_{i-1} + \epsilon_i $$ for $i_2\ldots i_T$, where $\alpha$ and $\beta$ are the estimated coefficients and ...
0
votes
0answers
57 views

MonteCarlo simulations to test light curve variability

I have an average orbital light curve for a source, that is, binned count rate vs orbital phase, where the count rate are averaged over a number of orbit. I want to run MonteCarlo simulations to find ...
2
votes
2answers
445 views

Metropolis-Hastings Algorithm within Gibbs Sampling

I have this $f$ function below. $$ f(x_1,x_2)\propto \left(\dfrac{x_1}{x_2}\right)\left(\dfrac{\alpha}{x_2}\right)^{x_1-1}exp\left\{-\left(\dfrac{\alpha}{x_2}\right)^{x_1} \right\}I_{R^+}(x) $$ where ...
8
votes
2answers
466 views

Is Markov chain based sampling the “best” for Monte Carlo sampling? Are there alternative schemes available?

Markov Chain Monte Carlo is a method based on Markov chains that allows us to obtain samples (in a Monte Carlo setting) from non-standard distributions from which we cannot draw samples directly. My ...
0
votes
0answers
33 views

Marginal distribution MLE or MCMC

I'm a bit confused about how to maximise the following likelihood: $\mathcal{L}(k, \lambda, p) \sim \mathrm{Binomial}(n, k, p)\mathrm{Poisson}(\lambda, n)$ i.e. my probability is relatd to a number ...
10
votes
2answers
193 views

What is this trick with adding 1 here?

I was looking at this page on Lillefors test's Monte Carlo implementation. I don't understand this sentence: There is random error in this calculation from the simulation. However, because of ...
0
votes
0answers
26 views

cumulative uncertainty with time series predictive model

So I have a time-series with a set of variables a, b, c... and another measured variable y. What I do is using the initial state of a,b,c and y (at t0), I predict what y "should" be at the next time ...
5
votes
1answer
205 views

Monte carlo simulation in R

I am trying to solve the following exercise but I actually have no clue on how to start doing this. I've found some code in my book that looks like it but it's a completely different exercise and I ...
2
votes
1answer
72 views

Information theory without normalization

I'd like to know if there is a way anyone knows of for doing information theory with unnormalized densities. Specifically, I hav two log likelihoods $\phi(x), \psi(x)$ and so I can write: $p(x) = ...
0
votes
0answers
14 views

What sort of data would be appropriate to analyze under an MCMC method?

MCMC methods describe stochastic sampling but I'm not entirely sure the contexts in real datasets one would wish to apply MCMC methods. What kind of data could I gain insight into with MCMC methods?
2
votes
0answers
26 views

Comparison of MCMC methods? [closed]

Where can I find a good comparison of Gibbs, Metropolis, and Hybrid MCMC in R or Python? I have thus far found this ...
5
votes
1answer
84 views

Error bars on log of big numbers

I am calculating a quantity of the following form: $\mu = \log( \frac{1}{n} \sum_{i=1}^{n} e^{\phi(X_i)} )$ via MC. $X_i$ are iid and I can sample them. I want to give error bars\ confidence ...