首页 > 其他分享 >STAT 2011概率与评价理论

STAT 2011概率与评价理论

时间:2023-05-16 12:46:17浏览次数:44  
标签:STAT 概率 20 sample need distribution 2011 your mean


STAT 2011 Probability and Estimation Theory – Semester 1, 2023
Computer Assignment – Due by 23:59pm 21 May
Instructions: Complete this computer assignment, prepare a report including your code, and
any output, plots or comments required by the questions and submit it on the Assignment item
on Canvas. The file upload format is limited to pdf and html. We highly encourage you to knit
your report using R Markdown, but the report can be created any way that is convenient as
long as it includes all the required content.
1. In a gambling game, a player wins the game if they roll 10 fair, six-sided dice, and get a
sum of at least 40.
(a) Approximate the probability of winning by simulating the game 104 times. Use
set.seed(200) for this question. Output your approximate probability, but do not
print your simulated rolls.
(b) Compute the Central Limit Theorem approximation P (Y ≥ 40), where Y is the sum
of 10 dice, and compare it to the Monte Carlo approximation obtained above. You
can use the fact that E(Y ) = 35, Var(Y ) = 175/6.
2. The frequency table below summarises 320 counts,
Value 0 1 2 3 4
Freq 130 133 49 7 1
modelled as values taken by i.i.d. random variables with common Bin(4, p) distribution,
i.e.
for some unknown p.
(a) Recall E(X) = np, estimate p using the method of moments.
(b) Using (a), find expected frequencies (E) for each of the classes “0”, “1”, “2”, “3”
and “4”. Round to the nearest integer.
(c) Compute standardised residuals (SR) given by SR = O?E√
E
for each of the classes
“0”, “1”, “2”, “3” and “4’, where O represents the observed frequencies. If |SR| < 2,
then the fitted binomial model is said to be a good model for the data. Comment
on the goodness of fit.
3. Use set.seed(100) to answer this question.
(a) Generate a random sample of size 25 from a normal distribution with mean μ = 3
and standard deviation σ = 1.5. Assume σ is known and we want to estimate μ.
Using the sample generated, find a 95% confidence interval (CI) for μ.
(b) Repeat the process in (a) 20 times. Using your 20 samples, calculate 20 CIs for μ.
How many of these 20 intervals contain the true mean μ = 3? Output this number
from your code, but no need to print the 20 CIs themselves.
1
4. Use set.seed(100) to answer this question.
(a) Generate a random sample of size 30 from the exponential distribution with param-
eter λ = 2 and find the mean of your sample. Repeat this process 1000 times and
draw a histogram of these 1000 means (use prob=T in hist). (Do not print the 1000
means.)
(b) Next we check whether the Central Limit Theorem gives a good approximation for
the distribution of the means. Overlay the histogram with a normal density curve
with appropriate mean and variance. (You will need to use the mean and variance
of exponential distributions from lectures. No need to derive). Comment on the fit.

标签:STAT,概率,20,sample,need,distribution,2011,your,mean
From: https://www.cnblogs.com/messagejava/p/17405022.html

相关文章

  • ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
     001、在利用python2.7环境下利用pip安装pyfaidx模块时报如下错误:ERROR:Commanderroredoutwithexitstatus1:pythonsetup.pyegg_infoCheckthelogsforfullcommandoutput. 002、查看pip版本[root@PC1pip]#pip--versionpip20.3.4from/usr/lib/pyth......
  • Java并发(六)----线程start、run、state方法
    1、start与run调用runpublicstaticvoidmain(String[]args){  Threadt1=newThread("t1"){    @Override    publicvoidrun(){      log.debug(Thread.currentThread().getName());//打印线程名称      FileRe......
  • 005 概率
    在统计学中,把从概率分布中抽取样本的过程称为抽样。将概率分配给一些离散选择的分布称为多项分布。 一个多项分布的模拟实验我们做一个实验,从公平的骰子的一次投掷出现的点数中抽样。上面的代码做了一个模拟实验。首先使用fromtorch.distributionimportmultinomial导入需......
  • MATLAB代码 风光场景生成 场景削减 概率距离削减法 蒙特卡洛法 M
    MATLAB代码风光场景生成场景削减概率距离削减法蒙特卡洛法MATLAB:基于概率距离快速削减法的风光场景生成与削减方法参考文档:《含风光水的虚拟电厂与配电公司协调调度模型》完全复现场景削减部分仿真平台:MATLAB平台代码具有一定的深度和创新性,注释清晰主要内容:风电、光伏以及......
  • git status check
    check-outdated-files.sh if[-n"$(gitstatus--porcelain)"]; then  gitdiff  forfin$(gitls-files--modified); do    echo"::warning::$fmaybeoutdated"  done  forfin$(gitls-files--others--exclude-standar......
  • JDBC学习日志四,PreparedStatement
    PreparedStatement可以防止sql注入问题,效率更高先进行预编译sql,将要设置的字段值使用占位符本质:预编译会将传递进来的参数包裹成字符,而单引号会被转义字符转换为空内容,有效的防止sql注入的问题CRUD--SELECTStringsql="select*fromuserswhereid=?";st=......
  • vuex 使用 vuex-persistedstate 数据持久化
    1、安装npmivuex-persistedstateyarnaddvuex-persistedstate2、在store.js中引入importcreatePersistedStatefrom"vuex-persistedstate"举例:importVuefrom'vue'importVuexfrom'vuex'importcreatePersistedStatefrom"v......
  • 概率潮流计算MATLAB程序,这程序采用Monte Carlo模拟方法和不同的近似贝叶斯计算方法。
    概率潮流计算MATLAB程序,这程序采用MonteCarlo模拟方法和不同的近似贝叶斯计算方法。其中,贝叶斯计算可以参考IEEETrans文章:ZuluagaC.D.,álvarezM.A.(2018)BayesianProbabilisticPowerFlowAnalysisUsingJacobianApproximateBayesianComputation,toappearatIEE......
  • MATLAB:基于概率距离快速削减法的风光场景生成与削减
    MATLAB:基于概率距离快速削减法的风光场景生成与削减方法关键词:概率距离场景削减场景生成蒙特卡洛场景法风光不确定性参考文档:《含风光水的虚拟电厂与配电公司协调调度模型》完全复现场景削减部分仿真平台:MATLAB平台代码具有一定的深度和创新性,注释清晰可懂[hot][hot][hot......
  • k8s 之statefulset有状态应用
    StatefulSet由以下几个部分组成:1.HeadlessService:用来定义pod网路标识,生成可解析的DNS记录2.volumeClaimTemplates:存储卷申请模板,创建pvc,指定pvc名称大小,自动创建pvc,且pvc由存储类供应。3.StatefulSet:管理pod的Headlessservice不分配clusterIP,headlessse......