Displaying 20 results from an estimated 20000 matches similar to: "Stats Question: Single data item versus Sample from Normal Distribution"
2005 Apr 05
2
Stats Question: Single data item versus Sample from Norma l Distribution
Here's one possibility, assuming muhat and sigmahat are estimtes of mu and
sigma from N iid draws of N(mu, sigma^2):
tStat <- abs(x - muhat) / sigmahat
pValue <- pt(tStat, df=N, lower=TRUE)
I'm not quite sure what df tStat should have (exercise for math stat), but
given fairly large N, that should make little difference.
Andy
> From: Ross Clement
>
> Hi. I have a
2012 Aug 22
2
log-normal distribution fitting with expected value = 1
Dear R users,
I would like to estimate mu and sigma of a log-normal distribution, where I
know that the expected value is 1, as it is a normalized distribution. That
means as E(x) = exp (mu + 1/2*sigma^2) = 1 that 2*mu = -sigma^2 . Therefore
I only need to fit one parameter either sigma or mu. How could I do this in
R?
Thank you very much for your help!
biophil
[[alternative HTML version
2008 Jul 22
2
F test
Dear R users,
I need to do a F test on the hypothesis that a 2 by 1 vector (X_1, X_2)' has the mean vector (M_1, M_2)'. Specifically, I would like to assume the X vector comes from a bivariate Normal distribution (M, Sigma). Then, given 1000 observations on X, I wanted to test if the means of X agree with the means of the target Normal distribution. Any function or package in R could do
2008 Sep 15
2
help on sampling from the truncated normal/gamma distribution on the far end (probability is very low)
Hi, guys,
I am trying to sample from a truncated normal/gamma distribution.
But only the far end of the distribution (where the probability is very low)
is left. e.g.
mu = - 4;
sigma = 0.1;
The distribution is Normal(mu,sigma^2) truncated on [0,+Inf];
How can I get a sample? I tried to use inverse CDF method, but got Inf as
answers. Please help me out.
Also, pls help me on the similar
2008 Mar 27
2
options in 'rnorm' to set the lower bound of normal distribution to 0 ?
Dear list,
I have a dataset containing values obtained from two different instruments (x and y).
I want to generate 5 samples from normal distribution for each instrument based on
their means and standard deviations. The problem is values from both instruments are
non-negative, so if using rnorm I would get some negative values. Is there any options
to determine the lower bound of normal
2006 Jul 20
1
Loss of numerical precision from conversion to list ?
I?m working on an R-implementation of the simulation-based finite-sample null-distribution of (R)LR-Test in Mixed Models (i.e. testing for Var(RandomEffect)=0) derived by C. M. Crainiceanu and D. Ruppert.
I'm in the beginning stages of this project and while comparing quick and dirty grid-search-methods and more exact optim()/optimize()-based methods to find the maximum of a part of the
2013 Sep 15
1
DataEllipse versus Ellipse Function in R
Hi:
Does Ellipse and dataellipse function in R produce the same ellipse? I
wanted to see how the radius for the Ellipse function in R calculated. Also
what is the var-covariance matrix, if any, assumed for the dataellipse
function? Heres an example of the code where I am generating Multivariate
normal data and creating ellipse using the 2 functions:
library(car)
library(mvtnorm)
mu =
2003 Sep 30
2
truncated multivariate normal
Please,
I would like to know how to generate a truncated multivariate normal
distribution k - dimensional, X ~ NT(mu, Sigma), where the
elements of X to be non-negative (except the first), and the first
dimension is strictly larger than zero.
Example:
X ~ NT_2(mu, Sigma),
where mu=c(0.5, 0.5) and Sigma=c([120, 191], [191,154]), with X_1>0
and X_2>=0
Could anybody help
2006 Oct 31
2
Put a normal curve on plot
I would like to be able to place a normal distribution surrounding the
predicted values at various places on a plot. Below is some toy code
that creates a scatterplot and plots a regression line through the data.
library(MASS)
mu <- c(0,1)
Sigma <- matrix(c(1,.8,.8,1), ncol=2)
set.seed(123)
x <- mvrnorm(50,mu,Sigma)
plot(x)
abline(lm(x[,2] ~ x[,1]))
Say I want to add a normal
2004 Mar 29
1
Right shift for normality
Hello,
My data is discrete, taking values between around -5 and +5.
I cannot give bounds for the values. So I consider it as
numerical data and not categorical data.
The histogram has a 'normal' shape, so
I test for normality via a chisquare statistic (by calculating the expected
values by hand).
When I use the sample mean and variance, the normality hypothesis has to be
rejected.
2016 Jul 17
2
Muestrear de una normal multivariante.-
¡Hola a todos!
Estoy intentando muestrear de una normal multivariante donde hay dos grupos
de variables que deben tener una relación "manipulable" entre sí pero
ignoro cómo hacerlo.
Les cuento, he intentado lo siguiente:
# covarianzas del primer grupo de variables:
Sigma_U <- matrix(c(.25, .2, .2, .25), ncol=2)
# covarianzas del segundo grupo de variables:
Sigma_W <- diag(2)
#
2009 Sep 24
1
Fw: Re: Multiple Normal Curves
Sorry about the subject
--- On Thu, 24/9/09, KABELI MEFANE <kabelimefane@yahoo.co.uk> wrote:
From: KABELI MEFANE <kabelimefane@yahoo.co.uk>
Subject: Re: [R] Multiply Normal Curves
To: R-help@r-project.org
Date: Thursday, 24 September, 2009, 11:48 AM
R -helpers
i have been trying to do this problem without must success,i managed to do a graph for x, but it is not what i want to
2004 Jun 25
2
Simulating from a Multivariate Normal Distribution Using a Correlation Matrix
Hello,
I would like to simulate randomly from a multivariate normal distribution using a correlation
matrix, rho. I do not have sigma. I have searched the help archive and the R documentation as
well as doing a standard google search. What I have seen is that one can either use rmvnorm in
the package: mvtnorm or mvrnorm in the package: MASS. I believe I read somewhere that the latter
was
2011 Jun 25
2
Multivariate normal density in C for R
Does anyone know of a package that uses C code to calculate a multivariate
normal density?
My goal is to find a faster way to calculate MVN densities and avoid R loops
or apply functions, such as when X and mu are N x K matrices, as opposed to
vectors, and in this particular case, speed really matters. I would like to
be able to use .C or .Call to pass X, mu, Sigma, and N to a C program and
have
2008 Apr 01
1
set the lower bound of normal distribution to 0 ?
Tom Cohen <tom.cohen78@yahoo.se> skrev: Thanks Prof Brian for your suggestion.
I should know that for right-skewed data,
one should generate the samples from a lognormal.
My problem is that x and y are two instruments that were thought to
be measured the same thing but somehow show a wide confidence interval
of the difference between the two intruments.This may be true that
these
2008 Jul 05
5
help about random generation of a Normal distribution of several variables
Hello.
Somebody knows how can I generate a set of n random vectors of a
normal distribution of several variables?
For example, I want to generate n=100 random vectors of two dimensions
for a normal with mean c(0,1) and variance matrix:
matrix(c(2,1,1,3),2,2).
Thanks in advance,
Arnau.
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings:
I would like comments on this example and after fixing it up, I need
help from someone who has access to insert this in R's help page for
plotmath.
I uploaded a drawing
http://pj.freefaculty.org/R/Normal-2009.pdf
that is created by the following code
http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R
This will be a good addition to the plotmath help page/example.
2010 Jul 06
1
plotmath vector problem; full program enclosed
Here's another example of my plotmath whipping boy, the Normal distribution.
A colleague asks for a Normal plotted above a series of axes that
represent various other distributions (T, etc).
I want to use vectors of equations in plotmath to do this, but have
run into trouble. Now I've isolated the problem down to a relatively
small piece of working example code (below). If you would
2012 Sep 11
1
Strange result from GAMLSS
Hi Folks! Just started using the gamlss package and I tried a simple code
example (see below). Why the negative sigma?
John
> y <- rt(100, df=1)> m1<-fitDist(y, type="realline")Warning messages:1: In MLE(ll3, start = list(eta.mu = eta.mu, eta.sigma = eta.sigma, :
possible convergence problem: optim gave code=1 false convergence
(8)2: In MLE(ll4, start = list(eta.mu =
2006 Aug 04
2
Doubt about Student t distribution simulation
Dear R list,
I would like to illustrate the origin of the Student t distribution using R.
So, if (sample.mean - pop.mean) / standard.error(sample.mean) has t
distribution with (sample.size - 1) degree free, what is wrong with the
simulation below? I think that the theoretical curve should agree with
the relative frequencies of the t values calculated:
#== begin options=====
# parameters