Essay Available:
Pages:
7 pages/β1925 words
Sources:
No Sources
Style:
APA
Subject:
Mathematics & Economics
Type:
Statistics Project
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
$ 36.29
Topic:
Analyze The Sample Mean And Compare It To The Theoretical Mean
Statistics Project Instructions:
simulation project, the instruction is in the oral-exam pdf.
Statistics Project Sample Content Preview:
#console to analyze the sample mean and compare it to the theoretical mean
set.seed(1)
lambda<-0.2
nexp<-40
nsim<-1000
mns<-NULL
for(i in 1:nsim) mns<-c(mns,mean(rexp(40,lambda)))
hist(mns, col="blue", main="distributions of means of rexp")
## console for comparing the variance of the means vs the theoretical variance
varexp<-((1/lambda)^2)/nexp ##theoritical variance
varmean<-var(mns) ## variance of the means
##simulation initialization
lambda<-0.2
mu<-1/lambda
n<-40
nosim<-100
nosim2<-2000
simulations<-rexp(n*nosim2,lambda)
simulations40<-matrix(simulations[1:(n*nosim)],nosim)
simulations40by2000<-matrix(simulations,nosim2)
##comparing sample mean and theoritical mean
means<-cumsum(simulations[1:1000])/(1:1000)
library(ggplot2)
Updated on
set.seed(1)
lambda<-0.2
nexp<-40
nsim<-1000
mns<-NULL
for(i in 1:nsim) mns<-c(mns,mean(rexp(40,lambda)))
hist(mns, col="blue", main="distributions of means of rexp")
## console for comparing the variance of the means vs the theoretical variance
varexp<-((1/lambda)^2)/nexp ##theoritical variance
varmean<-var(mns) ## variance of the means
##simulation initialization
lambda<-0.2
mu<-1/lambda
n<-40
nosim<-100
nosim2<-2000
simulations<-rexp(n*nosim2,lambda)
simulations40<-matrix(simulations[1:(n*nosim)],nosim)
simulations40by2000<-matrix(simulations,nosim2)
##comparing sample mean and theoritical mean
means<-cumsum(simulations[1:1000])/(1:1000)
library(ggplot2)
Get the Whole Paper!
Not exactly what you need?
Do you need a custom essay? Order right now:
π Other Visitors are Viewing These APA Statistics Project Samples:
- Sampling and Regression Analysis1 page/β275 words | 3 Sources | APA | Mathematics & Economics | Statistics Project |
- Two-tailed Test using Statdisk to Compute T-tests1 page/β275 words | 1 Source | APA | Mathematics & Economics | Statistics Project |
- Real Estate Managerial Report (MTH410)10 pages/β2750 words | 2 Sources | APA | Mathematics & Economics | Statistics Project |
- Hypothesis Testing and Type Errors3 pages/β825 words | No Sources | APA | Mathematics & Economics | Statistics Project |
- Introduction to Probability Theory & Health Statistics2 pages/β550 words | 3 Sources | APA | Mathematics & Economics | Statistics Project |
- Macroeconomic Factors - Evidence from USA8 pages/β2200 words | 4 Sources | APA | Mathematics & Economics | Statistics Project |
- Statistics Project3 pages/β825 words | 3 Sources | APA | Mathematics & Economics | Statistics Project |