// Numbas version: finer_feedback_settings {"variable_groups": [], "name": "Statistical inference", "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Calculate expectation, variance and CDF of uniform distribution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "name": "tol", "description": ""}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((upper-lower)^2/12,3)", "name": "ans2", "description": ""}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((c-lower)/(upper-lower),3)", "name": "ans3", "description": ""}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(d1=f1,d1-1,min(d1,f1))", "name": "d", "description": ""}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round((upper-lower-2)*random(0..60)/60+lower+1)", "name": "c", "description": ""}, "f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "max(d1,f1)", "name": "f", "description": ""}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(upper+lower)/2", "name": "ans1", "description": ""}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round((upper-lower-2)*random(0..60)/60+lower+1)", "name": "d1", "description": ""}, "ans4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((f-d)/(upper-lower),3)", "name": "ans4", "description": ""}, "upper": {"templateType": "anything", "group": "Ungrouped variables", "definition": "lower+random(2..20#2)", "name": "upper", "description": ""}, "lower": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-10..10)", "name": "lower", "description": ""}, "f1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round((upper-lower-2)*random(0..60)/60+lower)", "name": "f1", "description": ""}}, "ungrouped_variables": ["upper", "lower", "f", "d", "f1", "ans1", "ans2", "ans3", "ans4", "c", "tol", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ans1", "correctAnswerFraction": false, "marks": 1, "maxValue": "ans1"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ans2-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "ans2+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
The expectation $\\operatorname{E}[Y]=\\;$[[0]] (to 3 decimal places).
\nThe variance $\\operatorname{Var}(Y)=\\;$[[1]] (to 3 decimal places).
\n", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ans3-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "ans3+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
$P(Y \\le \\var{c})=\\;$[[0]]
\n(to 3 decimal places).
", "marks": 0}, {"scripts": {}, "gaps": [{"answer": "(y-{lower})/({upper-lower})", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "answersimplification": "basic", "expectedvariablenames": [], "notallowed": {"showStrings": false, "message": "Input all numbers as fractions or integers.
", "strings": ["."], "partialCredit": 0}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Input the CDF $F_Y(y)$ for $y$ in the range $\\var{lower} \\le y \\le \\var{upper}$
\n$F_Y(y)=\\;$[[0]]
\nInput all numbers as fractions or integers
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ans4-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "ans4+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$P(\\var{d} \\lt Y \\lt \\var{f})=\\;$[[0]]
\n\nEnter your answer to 3 decimal places.
", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Let $Y$ be a random variable with the uniform distribution
\n\\[Y \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\]
", "tags": ["CDF uniform", "checked2015", "continuous distributions", "expectation", "MAS1604", "Probability", "probability", "sc", "statistical distributions", "uniform distribution", "uniformly distributed", "variance"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "25/01/2013:
\nCopy made of 1403CBA3Q5 and then edited.
\nAdded fourth part.
\nTo be tested.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Exercise using a given uniform distribution $Y$, calculating the expectation and variance as well as asking for the CDF. Also finding $P(Y \\le a)$ and $P( b \\lt Y \\lt c)$ for a given values $a,\\;b,\\;c$.
"}, "advice": "a) For a Uniform distribution \\[Y \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\] we have:
\n$\\displaystyle \\operatorname{E}[Y] = \\simplify[!collectNumbers]{({lower}+{upper})/2}=\\var{ans1}$
\n$\\displaystyle \\operatorname{Var}(Y) =\\simplify[basic,!collectNumbers,!noleadingminus]{({upper}-{lower})^2/12}=\\frac{\\var{upper-lower}^2}{12}=\\var{ans2}$ to 3 decimal places.
\nb)
\n$\\displaystyle P(Y \\le \\var{c})=\\simplify[basic,!collectNumbers,!noleadingminus]{({c} -{lower})/({upper}-{lower})}=\\var{ans3}$ to 3 decimal places.
\nc) The CDF for a uniform distribution $Y$ on the interval $a \\le y \\le b$ is given by:
\n\\[F_Y(y) = \\begin{cases} 0 & y \\lt a \\\\ \\frac{y-a}{b-a} & a \\le y \\le b, \\\\ 1 & y \\gt b. \\end{cases}\\]
\nHence in this case we have:
\n\\[F_Y(y) = \\simplify[basic]{(y-{lower})/({upper-lower})}\\] for $\\var{lower}\\le y \\le \\var{upper}$
\nd) Using the CDF we have:
\n\\[\\begin{eqnarray}P(\\var{d} \\lt Y \\lt \\var{f})&=&F_Y(\\var{f})-F_Y(\\var{d})\\\\&=& \\simplify[basic]{({f}-{lower})/({upper-lower})- ({d}-{lower})/({upper-lower})}\\\\&=&\\var{ans4}\\end{eqnarray}\\]
\nto 3 decimal places.
"}, {"name": "Expectation and variance of combinations of estimators", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'B'", "name": "b", "description": ""}, "e3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s3*m", "name": "e3", "description": ""}, "unb2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=0,1,random(0,1))", "name": "unb2", "description": ""}, "s7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "s7", "description": ""}, "sqsum1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw1^2+cx1^2+cy1^2+cz1^2", "name": "sqsum1", "description": ""}, "wrong": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1*unb2>0,'C',if(unb1=1,'B','A'))", "name": "wrong", "description": ""}, "t3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb3=1,1,random(2..9))", "name": "t3", "description": ""}, "v1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqsum1*sd^2", "name": "v1", "description": ""}, "su2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw2+cx2+cy2+cz2", "name": "su2", "description": ""}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('W','X','Y','Z')", "name": "p", "description": ""}, "cy1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(cx1=0,random(1..9),random(-9..9))", "name": "cy1", "description": ""}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..6)", "name": "sd", "description": ""}, "cw1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cw1", "description": ""}, "t1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,1,random(2..9))", "name": "t1", "description": ""}, "tw": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "name": "tw", "description": ""}, "cy3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..9)", "name": "cy3", "description": ""}, "sqsum2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw2^2+cx2^2+cy2^2+cz2^2", "name": "sqsum2", "description": ""}, "v3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqsum3*sd^2", "name": "v3", "description": ""}, "s1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw1+cx1+cy1+cz1", "name": "s1", "description": ""}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "name": "tol", "description": ""}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'A'", "name": "a", "description": ""}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'C'", "name": "c", "description": ""}, "sqsum3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw3^2+cx3^2+cy3^2+cz3^2", "name": "sqsum3", "description": ""}, "s2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb2=1,su2,su2+random(1..4))", "name": "s2", "description": ""}, "unb1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0,1)", "name": "unb1", "description": ""}, "cz3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t3-cw3-cx3-cy3", "name": "cz3", "description": ""}, "cx2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cx2", "description": ""}, "cw3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "tw*random(10..40)", "name": "cw3", "description": ""}, "sx": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,-1)", "name": "sx", "description": ""}, "correct2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,if(unb2=1,'B','C'),'C')", "name": "correct2", "description": ""}, "cw2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cw2", "description": ""}, "q": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(p='X',random('W','Y','Z'),p='W',random('X','Y','Z'),p='Y',random('W','X','Z'),random('W','X','Y'))", "name": "q", "description": ""}, "e2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(su2*m/S2,2)", "name": "e2", "description": ""}, "e1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s1*m", "name": "e1", "description": ""}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "s7*random(1..10)", "name": "m", "description": ""}, "correct1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1=1,'A','B')", "name": "correct1", "description": ""}, "cz2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cz2", "description": ""}, "unb3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(unb1*unb2>0,0,1)", "name": "unb3", "description": ""}, "cy2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..9)", "name": "cy2", "description": ""}, "cx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-9..9)", "name": "cx1", "description": ""}, "s3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "cw3+cx3+cy3+cz3", "name": "s3", "description": ""}, "v2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sqsum2*sd^2/S2^2,2)", "name": "v2", "description": ""}, "cx3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "tx*sx*random(1..9)", "name": "cx3", "description": ""}, "cz1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "t1-cx1-cw1-cy1", "name": "cz1", "description": ""}, "tx": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(tw=0,1,0)", "name": "tx", "description": ""}}, "ungrouped_variables": ["cy3", "cy2", "cy1", "t3", "correct2", "correct1", "t1", "unb3", "unb2", "unb1", "s3", "tw", "s1", "s7", "tol", "cx1", "cx2", "cx3", "sqsum1", "sqsum3", "sqsum2", "cz2", "cz3", "cz1", "v1", "v2", "v3", "e1", "e3", "e2", "a", "c", "b", "tx", "cw1", "cw3", "cw2", "m", "wrong", "sx", "q", "p", "su2", "s2", "sd"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e1}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e1}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v1}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v1}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\simplify[std]{A = {cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}$
\n$ \\operatorname{E}[A]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(A)=\\;\\;\\;$[[1]]
\nInput both as integers.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e2-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e2+tol}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v2-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v2+tol}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\simplify[std]{B = (1 / {S2}) * ({cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z)}$
\n$\\operatorname{E}[B]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(B)=\\;\\;\\;$[[1]]
\nInput both to 2 decimal places.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{e3}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{e3}"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{v3}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{v3}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\simplify[std]{C = {cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}$
\n$ \\operatorname{E}[C]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(C)=\\;\\;\\;$[[1]]
\nInput both as integers.
", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "checkbox", "choices": ["$\\var{Correct1}$
", "$\\var{Correct2}$
", "$\\var{Wrong}$
"], "matrix": [1, 1, -1], "distractors": ["", "", ""], "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "scripts": {}, "maxMarks": 0, "type": "m_n_2", "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nWhich of the estimators $A,\\;\\;B$ or $C$ above are unbiased for $\\mu$? Select the correct choices.
You will lose a mark for selecting a wrong choice.
[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["$\\var{B}$
", "$\\var{A}$
", "$\\var{C}$
"], "matrix": [1, 0, 0], "distractors": ["", "", ""], "shuffleChoices": true, "scripts": {}, "maxMarks": 0, "type": "1_n_2", "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nWhich of the estimators $A,\\;\\;B$ or $C$ above is the most efficient?
\n \n \n \n[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{m^2}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{m^2}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Find $\\operatorname{E}[\\var{p}\\var{q}]=\\;\\;$[[0]]
", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Suppose $W,\\;\\;X,\\;\\;Y,\\;\\;$ and $Z$ are i.i.d. variables with mean $\\mu=\\var{m}$, standard deviation $\\sigma=\\var{sd}$
\nFind the expectation and variance of each of the following estimators of $\\mu$.
", "tags": ["IID", "MAS1604", "biased", "checked2015", "cr1", "efficient estimators", "estimators", "expectation", "i.i.d", "identical independent distributions", "iid", "independent identical distributions", "mean ", "random variables", "standard deviation", "statistics", "tested1", "unbiased", "unbiased estimators", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "13/07/2012:
\nAdded tags.
\nImproved and made consistent the display in various content areas.
\nSet new tolerance variable tol=0 for 2 dps numeric input questions.
\nAdded formula for $\\operatorname{Var}(aR+bS)$.
\nChecked calculation.
\nAdded description.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\nChecked calculation, OK. Added tested1 tag.
\nChecked rounding, OK. Added tag cr1.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given three linear combinations of four i.i.d. variables, find the expectation and variance of these estimators of the mean $\\mu$. Which are unbiased and efficient?
"}, "advice": "We use the result throughout these solutions that for independent random variables $R$ and $S$ then $\\operatorname{E}[aR+bS]=a \\operatorname{E}[R]+b\\operatorname{E}[S]$ and $\\operatorname{Var}(aR+bS)=a^2\\operatorname{Var}(R)+b^2\\operatorname{Var}(S)$.
\na)
\\[\\begin{eqnarray*} \\operatorname{E}[A] &=& \\operatorname{E}[\\simplify[std]{{cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}]\\\\ &=& \\simplify[std]{{cw1} * {m} + {cx1} * {m} + {cy1} * {m} + {cz1} * {m}}\\\\ &=& \\var{e1}\\\\ \\\\ \\\\ \\operatorname{Var}(A) &=& \\operatorname{Var}[\\simplify[std]{{cw1} * W + {cx1} * X + {cy1} * Y + {cz1} * Z}]\\\\ &=& \\simplify[std]{ {cw1 ^ 2} * Var(W) + {cx1 ^ 2} * Var(X) + {cy1 ^ 2} * Var(Y) + {cz1 ^ 2} * Var(Z)}\\\\ &=& \\simplify[std]{{cw1 ^ 2} * {sd ^ 2} + {cx1 ^ 2} * {sd ^ 2} + {cy1 ^ 2} * {sd ^ 2} + {cz1 ^ 2} * {sd ^ 2} }\\\\ &=& \\var{v1} \\end{eqnarray*} \\]
b)
\\[\\begin{eqnarray*} \\operatorname{E}[B] &=& \\frac{1}{\\var{S2}}\\left(\\operatorname{E}[\\simplify[std]{{cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z}]\\right)\\\\ &=& \\frac{1}{\\var{S2}}\\left(\\simplify[std]{{cw2} * {m} + {cx2} * {m} + {cy2} * {m} + {cz2} * {m}}\\right)\\\\ &=& \\var{e2}\\\\ \\\\ \\\\ \\operatorname{Var}(B) &=& \\frac{1}{\\var{S2^2}}\\left(\\operatorname{Var}[\\simplify[std]{{cw2} * W + {cx2} * X + {cy2} * Y + {cz2} * Z}]\\right)\\\\ &=& \\frac{1}{\\var{S2^2}}\\left(\\simplify[std]{ {cw2 ^ 2} * Var(W) + {cx2 ^ 2} * Var(X) + {cy2 ^ 2} * Var(Y) + {cz2 ^ 2} * Var(Z)}\\right)\\\\ &=& \\frac{1}{\\var{S2^2}}\\left(\\simplify[std]{{cw2 ^ 2} * {sd ^ 2} + {cx2 ^ 2} * {sd ^ 2} + {cy2 ^ 2} * {sd ^ 2} + {cz2 ^ 2} * {sd ^ 2} }\\right)\\\\ &=& \\var{v2} \\end{eqnarray*} \\]
c)
\\[\\begin{eqnarray*} \\operatorname{E}[C] &=& \\operatorname{E}[\\simplify[std,collectNumbers]{{cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}]\\\\ &=& \\simplify[std,collectNumbers]{{cw3} * {m} + {cx3} * {m} + {cy3} * {m} + {cz3} * {m}}\\\\ &=& \\var{e3}\\\\ \\\\ \\\\ \\operatorname{Var}(C) &=& \\operatorname{Var}[\\simplify[std]{{cw3} * W + {cx3} * X + {cy3} * Y + {cz3} * Z}]\\\\ &=& \\simplify[std]{ {cw3 ^ 2} * Var(W) + {cx3 ^ 2} * Var(X) + {cy3 ^ 2} * Var(Y) + {cz3 ^ 2} * Var(Z)}\\\\ &=& \\simplify[std]{{cw3 ^ 2} * {sd ^ 2} + {cx3 ^ 2} * {sd ^ 2} + {cy3 ^ 2} * {sd ^ 2} + {cz3 ^ 2} * {sd ^ 2} }\\\\ &=& \\var{v3} \\end{eqnarray*} \\]
d)
\nWe see that $\\var{Correct1},\\;\\;\\var{Correct2}\\;\\;$ are unbiased estimators for $\\mu=\\var{m}$ as their expectations are $\\var{m}$.
\ne)
\nThe most efficient estimator is $B$ as it has the smallest variance.
\nf)
Since $\\var{p}$ and $\\var{q}$ are independent we have:
$\\operatorname{E}[\\var{p}\\var{q}]=\\operatorname{E}[\\var{p}]\\operatorname{E}[\\var{q}] = \\var{m}\\times \\var{m} = \\var{m^2}$
"}, {"name": "Find maximum likelihood estimator of mean of normal distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"w": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=4,1,0)", "name": "w", "description": ""}, "mlephi": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(( t * ln(m/n+ b) + u * (a / (m/n + d)) + v * e ^ (m/(n*c)) + w * ((m/n) ^ 2 + g)),2)", "name": "mlephi", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=3,1,0)", "name": "v", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..9)", "name": "b", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..15)", "name": "c", "description": ""}, "var": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30)", "name": "var", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=1,1,0)", "name": "t", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "a", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0", "name": "tol", "description": ""}, "mlemu": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(m/n,2)", "name": "mlemu", "description": ""}, "r": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..4)", "name": "r", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(15..30)", "name": "n", "description": ""}, "d": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "d", "description": ""}, "g": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..9)", "name": "g", "description": ""}, "u": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(r=2,1,0)", "name": "u", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(150..500#5)", "name": "m", "description": ""}}, "ungrouped_variables": ["a", "c", "b", "d", "g", "m", "n", "w", "mlemu", "u", "t", "tol", "v", "var", "r", "mlephi"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mlemu+tol", "minValue": "mlemu-tol", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "\n \n \nUsing this data find the MLE $\\hat{\\mu}$ of $\\mu$ .
\n \n \n \n$\\hat{\\mu}=\\;\\;$[[0]]
\n \n \n \nEnter to 2 decimal places.
\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "mlephi+tol", "minValue": "mlephi-tol", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "Let \\[\\phi = \\simplify[std]{{t}*ln(mu+{b})+{u}*({a}/(mu+{d}))+{v}e^(mu/{c})+{w}*(mu^2+{g})}\\]
\nUsing the invariance property of maximum likelihood estimators, what is the MLE $\\hat{\\phi}$ of $\\phi$?
\n$\\hat{\\phi}=\\;\\;$[[0]] (make sure that you use an estimator for $\\mu$ which is accurate to 4 decimal places).
\nEnter to 2 decimal places.
", "showCorrectAnswer": true, "marks": 0}], "statement": "\nIn an experiment we take $\\var{n}$ observations $x_i$ from a Normal distribution with unknown mean $\\mu$ and variance $\\var{var}$.
\nFrom this sample we find:
\n\\[\\sum_{i=1}^{\\var{n}}x_i = \\var{m}\\]
\n ", "tags": ["checked2015", "cr1", "distributions", "functions", "invariance property of maximum likelihood estimators", "known variance", "MAS2302", "maximum likelihood estimator", "mean", "mean ", "mle", "MLE", "Normal distribution", "normal distribution", "query", "sample", "statistics", "sum of sample", "tested1", "unknown mean", "variance"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "14/07/2012:
\nAdded tags.
\nNew tolerance variable t=0 for the numeric inputs.
\nChecked calculations.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\n
Checked calculations for all functions appearing in this exercise. Added tested1 tag.
Rounding OK, added cr1 tag.
\nIn order to calculate the MLE for $\\phi$ need to use a more accurate value than that found for $\\mu$ to 2 decimal places. This is stated in the question now.
\nThere is no need to have the variance given. Added query tag for that.
\nAlso query the accuracy needed for the estimator of $\\mu$.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given sum of sample from a Normal distribution with unknown mean $\\mu$ and known variance $\\sigma^2$. Find MLE of $\\mu$ and one of four functions of $\\mu$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "a)
The MLE $\\hat{\\mu}$ of $\\mu$ is given by dividing the sum of the sample by the number of samples i.e.
\\[\\hat{\\mu}=\\frac{\\var{m}}{\\var{n}}=\\var{mlemu}\\] to 2 decimal places.
\nb)
In order to find the MLE $\\hat{\\phi}$ of \\[\\phi=\\simplify[std]{{t}*ln(mu+{b})+{u}*({a}/(mu+{d}))+{v}e^(mu/{c})+{w}*(mu^2+{g})}\\]
we note that $\\phi$ is 1-1 and so we can directly substitute $\\mu=\\hat{\\mu}$ into this to obtain:
\n\\[\\hat{\\phi} = \\simplify[std]{{t} * Ln({m} / {n} + {b}) + {u} * ({a} / ({m} / {n} + {d})) + {v} * e ^ (({m} / {n}) / {c}) + {w} * (({m} / {n}) ^ 2 + {g})} = \\var{mlephi}\\]
\nto 2 decimal places.
"}, {"name": "Find mean and standard deviation of differences between samples", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu1,sig1)),5)", "description": "", "name": "r1"}, "thismany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "5", "description": "", "name": "thismany"}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1.5..2.5#0.5)", "description": "", "name": "sig1"}, "performing": {"templateType": "anything", "group": "Ungrouped variables", "definition": " 'working at $\\\\var{100}$ watts on an exercise machine' ", "description": "", "name": "performing"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu2,sig2)),5)", "description": "", "name": "r2"}, "attempt": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'attempt'", "description": "", "name": "attempt"}, "meandiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(d)", "description": "", "name": "meandiff"}, "objects": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'people'", "description": "", "name": "objects"}, "mu1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(16..20#0.5)", "description": "", "name": "mu1"}, "sig2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sig1+random(-0.5..-0.2#0.1)", "description": "", "name": "sig2"}, "mu2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mu1+random(1..3#0.1)", "description": "", "name": "mu2"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "list(vector(r2)-vector(r1))", "description": "", "name": "d"}, "stdiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(d,true),3)", "description": "", "name": "stdiff"}, "object": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'person'", "description": "", "name": "object"}, "something": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Oxygen uptake values (mL/kg.min)'", "description": "", "name": "something"}}, "ungrouped_variables": ["meandiff", "performing", "attempt", "r1", "objects", "mu2", "object", "sig1", "thismany", "stdiff", "sig2", "something", "r2", "mu1", "d"], "functions": {}, "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "Find the mean and standard deviation of the difference between first and second {attempt}s.
\nCalculate differences for second {attempt} – first {attempt}.
\nMean of difference = [[0]] (input as an exact decimal)
\nStandard deviation of difference = [[1]] (input to 3 decimal places)
", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{meandiff}", "maxValue": "{meandiff}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "mustBeReducedPC": 0}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{stdiff}", "maxValue": "{stdiff}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "mustBeReducedPC": 0}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "{Something} for $\\var{thismany}$ {objects} {performing} were:
\n{capitalise(object)} | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
First {attempt} | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n
Second {attempt} | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n
An experiment is performed twice, each with $5$ outcomes
\n$x_i,\\;y_i,\\;i=1,\\dots 5$ . Find mean and s.d. of their differences $y_i-x_i,\\;i=1,\\dots 5$.
"}, "type": "question", "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "The table of differences is given by:
\n{capitalise(object)} | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
First {attempt} | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n
Second {attempt} | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n
Differences | \n$\\var{d[0]}$ | \n$\\var{d[1]}$ | \n$\\var{d[2]}$ | \n$\\var{d[3]}$ | \n$\\var{d[4]}$ | \n
The mean of the differences is $\\var{meandiff}$.
\nThe variance $V$ of the differences is
\n\\begin{align}
V &= \\frac{1}{4}\\left(\\simplify[]{({d[0]}^2+{d[1]}^2+{d[2]}^2+{d[3]}^2+{d[4]}^2)}-5\\times \\var{meandiff}^2\\right) \\\\
&= \\var{variance(d,true)}
\\end{align}
Hence the standard deviation is $\\sqrt{V}=\\var{stdiff}$ to 3 decimal places.
"}, {"name": "Find the expectation and variance of three estimators of the mean", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"s1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(sa/5)", "name": "s1", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0", "name": "tol", "description": ""}, "s5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round((t*(s4+1)+(100-t)*sa)/100)", "name": "s5", "description": ""}, "sc4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(sc2=0,random(1,-1),random(1,0,-1))", "name": "sc4", "description": ""}, "c4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sc4*random(1..6)", "name": "c4", "description": ""}, "s4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(4*sa/5)", "name": "s4", "description": ""}, "s2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(2*sa/5)", "name": "s2", "description": ""}, "vara": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(sd^2/sa,2)", "name": "vara", "description": ""}, "c2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sc2*random(1..6)", "name": "c2", "description": ""}, "sc5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,-1)", "name": "sc5", "description": ""}, "c3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "sc3*random(1..6)", "name": "c3", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(50..70)", "name": "m", "description": ""}, "mm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random('max','min')", "name": "mm", "description": ""}, "c5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "-su4+sc5*random(1..6)", "name": "c5", "description": ""}, "exc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "m*(su4+c5)", "name": "exc", "description": ""}, "varc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "(c1^2+c2^2+c3^2+c4^2+c5^2)*sd^2", "name": "varc", "description": ""}, "sd": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..15)", "name": "sd", "description": ""}, "sc3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,-1)", "name": "sc3", "description": ""}, "su4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "c1+c2+c3+c4", "name": "su4", "description": ""}, "c1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..5)", "name": "c1", "description": ""}, "birds": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random('hens','sparrows','robins','yellowhammers','reed warblers','bluetits','wrens','finches')", "name": "birds", "description": ""}, "s3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(3*sa/5)", "name": "s3", "description": ""}, "sc2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1,0,-1)", "name": "sc2", "description": ""}, "sa": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(12..25)", "name": "sa", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..100)", "name": "t", "description": ""}}, "ungrouped_variables": ["sc5", "vara", "varc", "sc4", "birds", "s3", "s2", "s1", "s5", "s4", "sc3", "tol", "sc2", "c3", "c2", "c1", "c5", "c4", "exc", "mm", "m", "su4", "t", "sa", "sd"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{m}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{m}"}, {"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{vara-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{vara+tol}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n$A = \\overline{W}$
\n(where $\\overline{W}$ denotes the random variable given by taking sample means of size $\\var{sa}$)
\n$ \\operatorname{E}[A]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(A)=\\;\\;\\;$[[1]]
\nInput $\\operatorname{Var}(A)$ to 2 decimal places.
\n ", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{m}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{m}"}, {"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{sd^2}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{sd^2}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n$B = W_{\\var{s3}}$
\n$\\operatorname{E}[B]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(B)=\\;\\;\\;$[[1]]
\n ", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{exc}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{exc}"}, {"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{varc}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{varc}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n$\\simplify[std]{C = {c1} * W_{s1} + {c2} *W_{s2} + {c3} *W_{s3} + {c4} * W_{s4}+{c5} * W_{s5}}$
\n$ \\operatorname{E}[C]=\\;\\;$[[0]]$\\;\\;\\;\\;\\operatorname{Var}(C)=\\;\\;\\;$[[1]]
\nInput both as integers.
\n ", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "checkbox", "choices": ["$A$
", "$B$
", "$C$
"], "matrix": [1, 1, -1], "distractors": ["", "", ""], "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "warningType": "none", "scripts": {}, "maxMarks": 0, "type": "m_n_2", "minMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\nWhich of the estimators $A,\\;B$ or $C$ above are unbiased for $\\mu$? Select the correct choices.
You will lose a mark for selecting a wrong choice.
[[0]]
\n ", "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["$A$
", "$B$
", "$C$
"], "matrix": [1, 0, 0], "distractors": ["", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "displayColumns": 3, "marks": 0}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\nWhich of the estimators $A,\\;B$ or $C$ above is the most efficient?
\n[[0]]
\n ", "marks": 0}], "variablesTest": {"condition": "exc<>m", "maxRuns": 100}, "statement": "\n \n \nFrom previous studies it is known that, $W$ the weight of eggs laid by {birds}, has mean $\\mu=\\var{m}$g and standard deviation $\\sigma=\\var{sd}$g.
\n \n \n \nA random sample of $\\var{sa}$ eggs was taken $\\{W_1,\\;W_2,\\ldots,\\;W_{\\var{sa}}\\}$ and their weights observed.
\n \n \n \nFind the expectation and variance of the following three estimators of $\\mu$
\n \n \n ", "tags": ["biased", "checked2015", "cr1", "distributions", "efficient estimators", "estimators", "estimators of mean", "expectation", "expectations", "MAS2302", "mean", "mean ", "means", "random samples", "random variables", "sample means", "sc", "statistics", "tested1", "unbiased", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "13/07/2012:
\nAdded tags.
\nImproved and made consistent the display in various content areas.
\nSet new tolerance variable tol=0 for 2 dps numeric input question.
\nChecked calculation.
\nAdded description.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\nChecked calculations, OK. Added tested1 tag.
\nChecked rounding, OK. Added cr1 tag.
\nCould have scenarios. Added sc tag.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Using a random sample from a population with given mean and variance, find the expectation and variance of three estimators of $\\mu$. Unbiased, efficient?
"}, "advice": "\nWe use the result throughout these solutions that for random variables $R$ and $S$ then
$\\operatorname{E}[aR+bS]=a\\operatorname{E}[R]+b\\operatorname{E}[S]$ and
$\\operatorname{Var}(aR+bS) = a^2\\operatorname{Var}(R)+b^2\\operatorname{Var}(S)$
\na)
\\[\\begin{eqnarray*} \\operatorname{E}[A] &=& \\operatorname{E}(\\overline{W})=\\mu=\\var{m}\\\\ \\\\ \\operatorname{Var}(A)&=&\\operatorname{Var}(\\overline{W})=\\frac{\\sigma^2}{n}=\\frac{\\var{sd^2}}{\\var{sa}}\\\\ =\\var{vara} \\end{eqnarray*} \\] to 2 decimal places.
b)
\\[\\begin{eqnarray*} \\operatorname{E}[B] &=& \\operatorname{E}(W_{\\var{s3}})=\\mu=\\var{m}\\\\ \\\\ \\operatorname{Var}(B)&=&\\operatorname{Var}(W_{\\var{s3}})=\\sigma^2=\\var{sd^2} \\end{eqnarray*} \\]
c)
\\[\\begin{eqnarray*} \\operatorname{E}[C] &=& \\operatorname{E}(\\simplify[std]{{c1} * W_{s1} + {c2} *W_{s2} + {c3} *W_{s3} + {c4} * W_{s4}+{c5} * W_{s5}})\\\\ &=&\\simplify[std]{ ({c1} + {c2} + {c3} + {c4} + {c5}) * {m} }\\\\ &=& \\var{exc}\\\\ \\\\ \\operatorname{Var}(C)&=&\\operatorname{Var}(\\simplify[std]{{c1} * W_{s1} + {c2} *W_{s2} + {c3} *W_{s3} + {c4} * W_{s4}+{c5} * W_{s5}})\\\\ &=& \\simplify[std]{({c1 ^ 2} + {c2 ^ 2} + {c3 ^ 2} + {c4 ^ 2} + {c5 ^ 2}) * {sd ^ 2} }\\\\ &=& \\var{varc} \\end{eqnarray*} \\]
d)
$A$ and $B$ are unbiased as their expectations are both $\\var{m}$.
e)
$A$ is the most efficient as it has the least variance.
Find the likelihood function for $t$ given these observations.
\n \n \n \n$L(t|\\underline{x})=\\;\\;$[[0]]
\n \n ", "marks": 0}, {"scripts": {}, "gaps": [{"answer": "(Ln({(8 * prod)}) + (3 * Ln(t)) - ({sumsq} * t))", "vsetrange": [0, 1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "answersimplification": "std", "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Hence find the log-likelihood function for $t$
\n$l(t|\\underline{x})=\\;\\;$[[0]]
\nIf $\\ln(a)$, for some integer $a$, is a term in your answer, leave as $\\ln(a)$ and do not evaluate.
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "mle-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "mle+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Find the MLE $\\hat{t}$ for $t$
\n$\\hat{t}=\\;\\;$[[0]]
\nInput to 2 decimal places.
", "marks": 0}, {"scripts": {}, "gaps": [{"answer": "-(3/t^2)", "vsetrange": [0, 1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "answersimplification": "std", "type": "jme", "showCorrectAnswer": true, "marks": 1, "vsetrangepoints": 5}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "m-tol", "showCorrectAnswer": true, "marks": 1, "maxValue": "m+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Now verify that you have indeed found a maximum:
\n1. First find $\\displaystyle\\frac{\\partial^2\\;l}{\\partial\\;t^2}=\\;\\;$[[0]].
\n2. Using the value of the MLE to 2 decimal places you have found:
\n$\\displaystyle\\frac{\\partial^2\\;l}{\\partial\\;t^2}$ evaluated at $\\hat{t}$ = [[1]].
\nInput to 2 decimal places.
", "marks": 0}], "statement": "The average annual wind speed, $X$, at {where} has the following probability density function with parameter $t$ which you have to estimate:
\n$f_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$ | \n$2txe^{-tx^2}$ | \n$x \\gt 0,$ | \n
\n | \n | |
$0$ | \n$\\textrm{otherwise.}$ | \n
For three randomly selected years, we observe the following average wind speeds:
\n$x_1=\\var{x1},\\;\\;x_2=\\var{x2}$ and $x_3=\\var{x3}$.
", "tags": ["checked2015", "cr1", "density function", "estimators", "likelihood functions", "log-likelihood function", "maximum", "maximum likelihood estimator", "mle", "MLE", "PDF", "pdf", "Probability", "probability", "probability density function", "random sample", "random variable", "sc", "second derivative", "statistics", "tested1", "unused"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "14/07/2012:
\nAdded tags.
\nCorrected mistakes in Advice.
\nAdded some text to make statement clearer re parameter $t$.
\nRephrased questions in last question so that it is clear that the value to 2dps is used in the calculation.
\nSpaced Advice text.
\nNew tolerance variable, tol=0 for last two questions.
\nAdded line in prompt: If $\\ln(a)$, for some integer $a$, is a term in your answer, leave as $\\ln(a)$ and do not evaluate.
\nImproved display of correct answer in second question as $+\\;- $ together. Also improved correct answer display in second last question.
\nImportant: set checking range between -0.2 and -0.1 rather than between 0 and 1 so that evaluation of likelihood function over the range does not suffer from underflow and incorrect answer marked as correct. This needs constant testing, have tested on bounday values and OK.
\n1/08/2012:
\nAdded tags.
\nIn the Advice section, moved \\Rightarrow to the beginning of the line instead of the end of the previous line.
\n21/12/2012:
\nChecked calculations, OK. Added tested1 tag.
\nChecked rounding, OK. Added cr1 tag.
\nScenarios, so added sc tag.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given a PDF $f(x)$ on the real line with unknown parameter $t$ and three random observations, find log-likelihood and MLE $\\hat{t}$ for $t$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "a)
\n\\[ \\begin{eqnarray*} L(t|\\underline{x})&=& \\var{2*x1}te^{-\\var{x1}^2t}\\times \\var{2*x2}te^{-\\var{x2}^2t} \\times \\var{2*x3}te^{-\\var{x3}^2t}\\\\ &=& \\var{8*prod}t^3e^{-\\var{sumsq}t} \\end{eqnarray*} \\]
b)
The log-likelihood function is :
\\[\\begin{eqnarray*} l(t|\\underline{x})&=&\\ln\\left( \\var{8*prod}t^3e^{-\\var{sumsq}t}\\right)\\\\ &=&\\ln(\\var{8*prod})+3\\ln(t)-\\var{sumsq}t \\end{eqnarray*} \\]
c)
\nWe have:
\\[\\frac{\\partial\\;l}{\\partial\\;t}=\\frac{3}{t}-\\var{sumsq}\\]
Now:
\\[\\begin{eqnarray*} \\frac{\\partial\\;l}{\\partial\\;t}&=&0 \\\\ \\Rightarrow \\frac{3}{t}-\\var{sumsq}&=&0\\\\ \\Rightarrow t&=&\\frac{3}{\\var{sumsq}} = \\var{mle} \\end{eqnarray*} \\] to 3 decimal places.
And putting $t=\\hat{t}$ gives the MLE $\\hat{t}=\\var{mle}$
d)
\\[\\frac{\\partial^2\\;l}{\\partial\\;t^2}=-3t^{-2} \\lt 0\\]
when evaluated at any point including $t=\\hat{t}=\\var{mle}$.
Hence gives a maximum at $t=\\hat{t}$.
"}, {"name": "20122013 CBA0_2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"rs": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[\n ['$X_1$',random(2..6),random(1..5)],\n ['$X_2$',random(2..6),random(1..5)],\n ['$X_3$',random(2..6),random(1..5)]\n ]", "name": "rs", "description": ""}, "var": {"group": "Ungrouped variables", "templateType": "anything", "definition": "a^2*rs[0][2]+b^2*rs[1][2]+c^2*rs[2][2]", "name": "var", "description": ""}, "d": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-9..9 except [0,1,-1])", "name": "d", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-9..9 except [0,1,-1])", "name": "c", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-9..9 except [0,1,-1])", "name": "b", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(-9..9 except [0,1,-1])", "name": "a", "description": ""}, "ex": {"group": "Ungrouped variables", "templateType": "anything", "definition": "a*rs[0][1]+b*rs[1][1]+c*rs[2][1]+d", "name": "ex", "description": ""}}, "ungrouped_variables": ["a", "c", "b", "d", "rs", "ex", "var"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"scripts": {}, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "ex", "minValue": "ex", "correctAnswerFraction": false, "marks": 1}, {"scripts": {}, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "var", "minValue": "var", "correctAnswerFraction": false, "marks": 1}], "type": "gapfill", "prompt": "Find the expectation and variance of:
\n\\[Y=\\simplify[basic]{{a}*X_1+{b}*X_2+{c}*X_3+{d}}\\]
\n$\\operatorname{E}[Y]=\\;$[[0]]
\n$\\operatorname{Var}(Y)=\\;$[[1]]
", "showCorrectAnswer": true, "marks": 0}], "statement": "Suppose that the three independent random variables $X_1,\\;X_2,\\;X_3$ have the following distributions:
\n{table(rs,[' ','Mean','Variance'])}
", "tags": ["MAS2302", "checked2015"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "25/01/2013:
\nFirst draft completed. Needs testing.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given a linear combination $Y$ of three independent random variables with given means and variances, find the mean of variance of $Y$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "If $Y=aX_1+bX_2+cX_3+d$ is a linear combination of independent random variables where $X_i$ has mean $m_i$ and variance $v_i,\\;i=1,\\;2,\\;3$ then
\n$\\operatorname{E}[Y]=am_1+bm_2+cm_3+d$ and $\\operatorname{Var}(Y)=a^2v_1+b^2v_2+c^2v_3$
\nFor this example we have:
\n$\\operatorname{E}[Y]=\\simplify[basic]{{a}*{rs[0][1]}+{b}*{rs[1][1]}+{c}*{rs[2][1]}+{d}}=\\var{ex}$ and
\n$\\operatorname{Var}(Y)=\\simplify[basic]{{a^2}*{rs[0][2]}+{b^2}*{rs[1][2]}+{c^2}*{rs[2][2]}}=\\var{var}$.
\n\n
"}, {"name": "20122013 CBA0_4", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ex1-tol", "maxValue": "ex1+tol", "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "
Find
\n$\\displaystyle \\operatorname{E}\\left[\\frac{1}{X}\\right]=\\;$?[[0]] (Input to 4 decimal places).
", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ex2-tol", "maxValue": "ex2+tol", "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "Let $Y=e^X$.
\nFind $\\operatorname{E}[Y]=\\;$?[[0]]
", "showCorrectAnswer": true, "marks": 0}], "variables": {"p2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-p0-p1,2)", "name": "p2", "description": ""}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.0001", "name": "tol", "description": ""}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "[[random(-2,-1,3,4,7,8),p0],[random(-3,2,5,6),p1],[random(-4,9,10),p2]]", "name": "v", "description": ""}, "p1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.3..0.5#0.05)", "name": "p1", "description": ""}, "ex2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tex2,4)", "name": "ex2", "description": ""}, "tex2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "p0*e^(v[0][0])+p1*e^(v[1][0])+p2*e^(v[2][0])", "name": "tex2", "description": ""}, "p0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..0.3#0.05)", "name": "p0", "description": ""}, "tex1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "p0*1/v[0][0]+p1*1/v[1][0]+p2*1/v[2][0]", "name": "tex1", "description": ""}, "ex1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tex1,4)", "name": "ex1", "description": ""}}, "ungrouped_variables": ["p2", "p0", "p1", "ex1", "tex1", "tex2", "ex2", "tol", "v"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "variable_groups": [], "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Suppose that the discrete random variable $X$ has the probability function:
\n\n
$x$ | \n$\\var{v[0][0]}$ | \n\n | $\\var{v[1][0]}$ | \n\n | $\\var{v[2][0]}$ | \n|
---|---|---|---|---|---|---|
$P(X=x)$ | \n$\\var{p0}$ | \n\n | $\\var{p1}$ | \n\n | $\\var{p2}$ | \n\n |
Answer the following questions:
", "tags": ["MAS2302", "checked2015", "discrete random variables", "expectation", "functions of a random variable", "statistics"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "25/01/2013:
\nFinished first draft. Need to be tested.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given a discrete random variable $X$ find the expectation of $1/X$ and $e^X$.
"}, "advice": "If $Y$ is a discrete random variable which can take values $v_1,\\;v_2,\\ldots,v_n$ with corresponding probabilities $p_1,\\;p_2,\\ldots,p_n$ then the expected value is given by:
\n\\[\\operatorname{E}[Y]=\\sum_{i=1}^n p_iv_i\\]
\na) $\\displaystyle Y=\\frac{1}{X} \\Rightarrow \\operatorname{E}[Y]=\\simplify[basic]{{p0}*(1/{v[0][0]})+{p1}*(1/{v[1][0]})+{p2}*(1/{v[2][0]})}=\\var{ex1}$ to 4 decimal places.
\nb) $\\displaystyle Y=e^X \\Rightarrow \\operatorname{E}[Y]=\\simplify[basic]{{p0}*e^{v[0][0]}+{p1}*e^{v[1][0]}+{p2}*e^{v[2][0]}}=\\var{ex2}$ to 4 decimal places.
"}, {"name": "Unbiased estimator for exponential distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"where": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random('at a supermarket checkout','at a fish shop queue','of calls to a call centre','of buses at a station','of hits at a particular website')", "name": "where", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0", "name": "tol", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround((1-1/n)*1/m,2)", "name": "t", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(5..25)", "name": "n", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.5..3.5#0.1 except 1)", "name": "m", "description": ""}}, "ungrouped_variables": ["where", "m", "t", "tol", "n"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "1/Y*(1-1/n)", "showCorrectAnswer": true, "vsetrange": [0, 1], "scripts": {}, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "type": "jme", "answersimplification": "std", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\nIf $Y$ is the random variable given by the sample mean on $n$ inter-arrival times write down an expression for an unbiased estimator $T$ of $\\theta$.
\n$T=\\;\\;$[[0]]
\n ", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{t-tol}", "correctAnswerFraction": false, "marks": 1, "maxValue": "{t+tol}"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "\n \n \nA random sample of $\\var{n}$ inter-arrival times gives a mean of $\\var{m}$ minutes.
\n \n \n \nFrom this sample, find an estimate $t$ of the parameter $\\theta$.
\n \n \n \n$t=\\;\\;$[[0]] (Enter to 2 decimal places).
\n \n \n ", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "The times between arrivals {where} can be described by an exponential distribution $X$ with parameter $\\theta$
", "tags": ["MAS1604", "arrivals", "checked2015", "cr1", "distributions", "estimate", "estimators", "exponential distribution", "inter arrival time", "inter-arrival times", "mean ", "random sample", "random variable", "random variables", "sample", "sample mean", "sc", "statistics", "tested1", "unbiased estimators"], "rulesets": {"std": ["all", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "13/07/2012:
\nAdded tags.
\nImproved display of correct answer.
\nSet new tolerance variable tol=0 for numeric input.
\nChecked calculation.
\nDescription written.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n21/12/2012:
\nImproved statement slightly. Also Advice - solution better displayed. Checked calculation. Added tested1 tag.
\nRounding OK, added cr1 tag.
\nPerhaps could have scenarios? Added sc tag.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Arrivals given by exponential distribution, parameter $\\theta$ and $Y$, sample mean on inter-arrival times. Find and calculate unbiased estimator for $\\theta$.
"}, "advice": "a)
An unbiased estimator for the parameter $\\theta$ is:
\\[T =\\frac{1}{Y} \\left(1-\\frac{1}{n}\\right)\\]
\nb)
Hence an estimate of $\\theta$ is given by:
\\[\\begin{eqnarray*} t&=&\\frac{1}{\\var{m}}\\left(1-\\frac{1}{\\var{n}}\\right)\\\\ &=&\\var{t} \\end{eqnarray*} \\] to 2 decimal places.
"}, {"name": "20122013 CBA1_1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans1-tol4", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans1+tol4"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans2-tol3", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans2+tol3"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "For $\\mu=\\var{m}$ calculate:
\n(i) $L(\\mu,\\underline{x})=\\;$? [[0]] (enter your answer to 4 decimal places).
\n(ii) $l(\\mu,\\underline{x})=\\;$? [[1]] (enter your answer to 3 decimal places).
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ans3-tol3", "showCorrectAnswer": true, "marks": 1, "maxValue": "ans3+tol3"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "The maximum likelihood estimator $\\hat{\\mu}$ for $\\mu$ is: [[0]]
\n(enter your answer as a decimal to 3 decimal places)
", "marks": 0}], "variables": {"tol3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol3", "description": ""}, "x2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5)", "name": "x2", "description": ""}, "x1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5 except x0)", "name": "x1", "description": ""}, "v": {"group": "Ungrouped variables", "templateType": "anything", "definition": "rowvector(x0,x1,x2)", "name": "v", "description": ""}, "ans1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(p[0]*p[1]*p[2],4)", "name": "ans1", "description": ""}, "x0": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..5)", "name": "x0", "description": ""}, "ans3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround((x0+x1+x2)/3,3)", "name": "ans3", "description": ""}, "tol4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.0001", "name": "tol4", "description": ""}, "p": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[e^(-m)*m^x0/fact(x0),e^(-m)*m^x1/fact(x1),e^(-m)*m^x2/fact(x2)]", "name": "p", "description": ""}, "ans2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(ln(p[0]*p[1]*p[2]),3)", "name": "ans2", "description": ""}, "m": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..3#0.5)", "name": "m", "description": ""}}, "ungrouped_variables": ["tol3", "ans1", "ans2", "ans3", "m", "tol4", "p", "v", "x2", "x0", "x1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Suppose $\\underline{x}=\\var{v}$ is a vector of observations from a $\\operatorname{Poisson}(\\mu)$ distribution.
", "tags": ["MAS2302", "MLE", "Poisson", "Poisson parameter", "checked2015", "distributions", "likelihood", "log likelihood", "maximum likelihood estimator", "mle", "statistical distributions", "statistics"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "26/01/2013:
\nFirst draft created.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given 3 observations from a $\\operatorname{Poisson}(\\mu)$ distribution find the likelihood, the log likelihood and the MLE for $\\mu$.
"}, "advice": "a) If there are 3 observations from $\\operatorname{Poisson}(\\mu),\\;(x_1,x_2,x_3)$ then:
\n(i) \\[\\operatorname{L}(\\mu|\\underline{x})=\\frac{e^{-\\mu}\\mu^{x_1}}{x_1!}\\times\\frac{e^{-\\mu}\\mu^{x_2}}{x_2!}\\times \\frac{e^{-\\mu}\\mu^{x_3}}{x_3!}\\]
\nFor this calculation $\\mu=\\var{m}$ and $(x_1,x_2,x_3)=\\var{v}$ and we obtain:
\n\\[\\operatorname{L}(\\mu|\\underline{x})=\\var{p[0]}\\times\\var{p[1]}\\times \\var{p[2]}=\\var{ans1}\\] to 4 decimal places.
\n(ii) \\[\\operatorname{l}(\\mu|\\underline{x})=\\ln(\\operatorname{L}(\\mu|\\underline{x}))=\\ln(\\var{p[0]}\\times\\var{p[1]}\\times \\var{p[2]})=\\var{ans2}\\]
\nto 3 decimal places.
\nb) The MLE is the mean of the observations i.e. \\[\\frac{\\var{x0}+\\var{x1}+\\var{x2}}{3} = \\var{ans3}\\] to 3 decimal places.
\n", "showQuestionGroupNames": false}, {"name": "2012 2013 CBA3_1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.01", "name": "tol", "description": ""}, "ulim": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tulim,2)", "name": "ulim", "description": ""}, "z": {"templateType": "anything", "group": "Ungrouped variables", "definition": "switch(per=95,1.96,per=99,2.58,3.29)", "name": "z", "description": ""}, "llim": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tllim,2)", "name": "llim", "description": ""}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..12)", "name": "sd", "description": ""}, "tllim": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r11-z*sqrt(sd^2/n)", "name": "tllim", "description": ""}, "mu": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(150..250)", "name": "mu", "description": ""}, "tulim": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r11+z*sqrt(sd^2/n)", "name": "tulim", "description": ""}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(25..100#5)", "name": "n", "description": ""}, "inf": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(n/sd^2,2)", "name": "inf", "description": ""}, "per": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(95,99,99.9)", "name": "per", "description": ""}, "r11": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(mean(repeat(normalsample(mu,sd),n)),1)", "name": "r11", "description": ""}}, "ungrouped_variables": ["r11", "tulim", "per", "n", "mu", "tol", "sd", "ulim", "inf", "z", "llim", "tllim"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "r11", "correctAnswerFraction": false, "marks": 1, "maxValue": "r11"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
Enter the m.l.e. $\\hat{\\mu}$ for $\\mu$ here:
\n$\\hat{\\mu}=\\;$?[[0]]
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "inf-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "inf+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Calculate the expected information $I(\\mu)$:
\n$I(\\mu)=\\;$[[0]] (to 2 decimal places).
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "llim-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "llim+tol"}, {"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ulim-tol", "correctAnswerFraction": false, "marks": 1, "maxValue": "ulim+tol"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Calculate a $\\var{per}$% confidence $(a,b)$ interval for $\\mu$:
\n$a=\\;$[[0]]
\n$b=\\;$[[1]]
", "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "$X_1,\\;X_2,\\;\\dots, X_n$ is a random sample from $\\operatorname{N}(\\mu,\\var{sd}^2)$.
\nLet $\\bar{x}$ denote the mean of this sample and for this exercise we have $n=\\var{n},\\; \\bar{x}=\\var{r11}$
", "tags": ["MAS2302", "MLE", "Normal distribution", "checked2015", "confidence interval", "expected information", "maximum likelihood estimator", "mean ", "mle", "normal distribution", "random sample", "sample mean"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "27/01/2013:
\nFirst draft completed.
", "licence": "Creative Commons Attribution 4.0 International", "description": "For a sample of size n from a normal distribution and given the mean of the sample and the standard deviation of the distribution, find the MLE for the mean. Also the expected information and a confidence interval for the mean.
"}, "advice": "a)
\nThe maximum likelihood estimator (m.l.e) is, in this case, the sample mean i.e. $\\hat{\\mu}=\\var{r11}$.
\nb)
\nThe expected information in this case is $\\displaystyle \\frac{n}{\\sigma^2}$ where $\\sigma=\\var{sd}$ is the standard deviation of the sampled normal distribution.
\nHence $\\displaystyle I(\\mu)=\\frac{\\var{n}}{\\var{sd^2}}=\\var{inf}$ to 2 decimal places.
\nc)
\nThe $\\var{per}$% confidence interval in this case is given by $(a,b)$ where:
\n\\[a=\\bar{x}-z\\sqrt{\\frac{\\sigma^2}{n}},\\;\\;b=\\bar{x}+z\\sqrt{\\frac{\\sigma^2}{n}},\\;\\;\\;z=\\var{z}\\]
\nCalculating to 2 decimal places gives:
\n$a=\\var{llim},\\;\\;\\;b=\\var{ulim}$.
\nHence a $\\var{per}$% confidence interval for the mean is given by $(\\var{llim},\\var{ulim})$.
"}, {"name": "2012 2013 CBA3_2", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"z": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(per=95,1.96,per=99,2.58,3.29)", "name": "z", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.01", "name": "tol", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(25..100#5)", "name": "n", "description": ""}, "mu": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(15..25)", "name": "mu", "description": ""}, "ulim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(tulim,2)", "name": "ulim", "description": ""}, "inf": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(n/r11,2)", "name": "inf", "description": ""}, "llim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(tllim,2)", "name": "llim", "description": ""}, "tulim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "r11+z*sqrt(r11/n)", "name": "tulim", "description": ""}, "tllim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "r11-z*sqrt(r11/n)", "name": "tllim", "description": ""}, "r11": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(mean(repeat(poissonsample(mu),n)),1)", "name": "r11", "description": ""}, "per": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(95,99,99.9)", "name": "per", "description": ""}}, "ungrouped_variables": ["r11", "tulim", "per", "n", "mu", "tol", "ulim", "inf", "z", "llim", "tllim"], "rulesets": {}, "showQuestionGroupNames": false, "variable_groups": [], "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "r11", "maxValue": "r11", "marks": 1}], "type": "gapfill", "prompt": "\nEnter the m.l.e. $\\hat{\\mu}$ for $\\mu$ here:
\n$\\hat{\\mu}=\\;$?[[0]]
\n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "inf-tol", "maxValue": "inf+tol", "marks": 1}], "type": "gapfill", "prompt": "\nCalculate the expected information $I(\\mu)$:
\n$I(\\mu)=\\;$[[0]] (to 2 decimal places).
\n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "llim-tol", "maxValue": "llim+tol", "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "ulim-tol", "maxValue": "ulim+tol", "marks": 1}], "type": "gapfill", "prompt": "\nCalculate a $\\var{per}$% confidence $(a,b)$ interval for $\\mu$:
\n$a=\\;$[[0]]
\n$b=\\;$[[1]]
\n ", "showCorrectAnswer": true, "marks": 0}], "statement": "$X_1,\\;X_2,\\;\\dots, X_n$ is a random sample from $\\operatorname{Poisson}(\\mu)$.
\nLet $\\bar{x}$ denote the mean of this sample and for this exercise we have $n=\\var{n},\\; \\bar{x}=\\var{r11}$
", "tags": ["MAS2302", "MLE", "Normal distribution", "checked2015", "confidence interval", "expected information", "maximum likelihood estimator", "mean ", "mle", "normal distribution", "random sample", "sample mean"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t27/01/2013:
\n \t\tFirst draft completed.
\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "For a sample of size n from a Poisson distribution $\\operatorname{Poisson}(\\lambda)$ and given the mean of the sample, find the MLE for $\\lambda$. Also find the expected information and a confidence interval for $\\lambda$.
"}, "functions": {}, "advice": "a)
\nThe maximum likelihood estimator (m.l.e) for $\\mu$ is the sample mean i.e. $\\hat{\\mu}=\\var{r11}$.
\nb)
\nThe expected information in this case is $\\displaystyle \\frac{n}{\\bar{x}}$.
\nHence $\\displaystyle I(\\mu)=\\frac{\\var{n}}{\\var{r11}}=\\var{inf}$ to 2 decimal places.
\nc)
\nThe $\\var{per}$% confidence interval for $\\mu$ in this case is given by $(a,b)$ where:
\n\\[a=\\bar{x}-z\\sqrt{\\frac{\\bar{x}}{n}},\\;\\;b=\\bar{x}+z\\sqrt{\\frac{\\bar{x}}{n}},\\;\\;\\;z=\\var{z}\\]
\nCalculating to 2 decimal places gives:
\n$a=\\var{llim},\\;\\;\\;b=\\var{ulim}$.
\nHence a $\\var{per}$% confidence interval for $\\mu$ is given by $(\\var{llim},\\var{ulim})$.
"}, {"name": "2012 2013 CBA3_3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.01", "name": "tol", "description": ""}, "ulim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(tulim,2)", "name": "ulim", "description": ""}, "z": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(per=95,1.96,per=99,2.58,3.29)", "name": "z", "description": ""}, "llim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(tllim,2)", "name": "llim", "description": ""}, "tllim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1/r11-z*sqrt(1/(n*r11^2))", "name": "tllim", "description": ""}, "mu": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(4..10)", "name": "mu", "description": ""}, "tulim": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1/r11+z*sqrt(1/(n*r11^2))", "name": "tulim", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(25..100#5)", "name": "n", "description": ""}, "inf": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(n*r11^2,2)", "name": "inf", "description": ""}, "per": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(95,99,99.9)", "name": "per", "description": ""}, "r11": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(mean(repeat(exponentialsample(mu),n)),1)", "name": "r11", "description": ""}, "mle": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(1/r11,2)", "name": "mle", "description": ""}}, "ungrouped_variables": ["mle", "r11", "tulim", "per", "n", "mu", "tol", "ulim", "inf", "z", "llim", "tllim"], "rulesets": {}, "functions": {}, "variable_groups": [], "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "mle-tol", "maxValue": "mle+tol", "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Enter the m.l.e. $\\hat{\\lambda}$ for $\\lambda$ here:
\n$\\hat{\\lambda}=\\;$?[[0]]
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "inf-tol", "maxValue": "inf+tol", "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Calculate the expected information $I(\\lambda)$:
\n$I(\\lambda)=\\;$[[0]] (to 2 decimal places).
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "llim-tol", "maxValue": "llim+tol", "marks": 1}, {"showPrecisionHint": false, "scripts": {}, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "ulim-tol", "maxValue": "ulim+tol", "marks": 1}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "Calculate a $\\var{per}$% confidence $(a,b)$ interval for $\\lambda$:
\n$a=\\;$[[0]]
\n$b=\\;$[[1]]
", "marks": 0}], "statement": "$X_1,\\;X_2,\\;\\dots, X_n$ is a random sample from $\\operatorname{Exponential}(\\lambda)$.
\nLet $\\bar{x}$ denote the mean of this sample and for this exercise we have $n=\\var{n},\\; \\bar{x}=\\var{r11}$
", "tags": ["MAS2302", "MLE", "Normal distribution", "checked2015", "confidence interval", "expected information", "maximum likelihood estimator", "mean ", "mle", "normal distribution", "random sample", "sample mean"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t \t\t27/01/2013:
\n \t\t \t\tFirst draft completed.
\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "For a sample of size n from an Exponential distribution $\\operatorname{Exponential}(\\lambda)$ and given the mean of the sample, find the MLE for $\\lambda$. Also find the expected information and a confidence interval for $\\lambda$.
"}, "advice": "a)
\nThe maximum likelihood estimator (MLE) for $\\lambda$ is given by
\n\\[\\operatorname{MLE} = \\frac{1}{\\bar{x}}=\\frac{1}{\\var{r11}}=\\var{mle}\\] to 2 decimal places.
\nb)
\nThe expected information in this case is:
\n$\\displaystyle \\operatorname{I}(\\lambda)=\\frac{n}{\\hat{\\lambda}^2}=n\\bar{x}^2=\\var{n}\\times\\var{r11}^2=\\var{inf}$ to 2 decimal places.
\nc)
\nThe $\\var{per}$% confidence interval for $\\lambda$ in this case is given by $(a,b)$ where:
\n\\[a=\\frac{1}{\\bar{x}}-z\\sqrt{\\frac{1}{n\\bar{x}^2}},\\;\\;b=\\frac{1}{\\bar{x}}+z\\sqrt{\\frac{1}{n\\bar{x}^2}},\\;\\;\\;z=\\var{z}\\]
\nCalculating to 2 decimal places gives:
\n$a=\\var{llim},\\;\\;\\;b=\\var{ulim}$.
\nHence a $\\var{per}$% confidence interval for $\\lambda$ is given by $(\\var{llim},\\var{ulim})$.
"}, {"name": "Look up values of t distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"u2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..9 except u1)", "name": "u2", "description": ""}, "p": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[0.75,0.800,0.850,0.900,0.950,0.975,0.990,0.995,0.999,0.9995]", "name": "p", "description": ""}, "v2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(tn)[u2+1]", "name": "v2", "description": ""}, "v1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(t)[u1+1]", "name": "v1", "description": ""}, "u1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..9)", "name": "u1", "description": ""}, "tn": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30 except t)", "name": "tn", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(6..12)", "name": "t", "description": ""}, "per": {"group": "Ungrouped variables", "templateType": "anything", "definition": "['DF','0.75','0.800','0.850','0.900','0.950','0.975','0.990','0.995','0.999','0.9995']", "name": "per", "description": ""}, "u3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..9 except [u1,u2])", "name": "u3", "description": ""}, "tm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30 except[t,tn])", "name": "tm", "description": ""}, "v3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(tm)[u3+1]", "name": "v3", "description": ""}}, "ungrouped_variables": ["v1", "u1", "per", "u2", "tn", "p", "v2", "tm", "u3", "v3", "t"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {"pc": {"type": "number", "language": "jme", "definition": "precround(studenttinv(p,n),3)", "parameters": [["p", "number"], ["n", "number"]]}, "cr": {"type": "list", "language": "jme", "definition": "\n [t,\n pc(0.75,t),\n pc(0.8,t),\n pc(0.85,t),\n pc(0.9,t),\n pc(0.95,t),\n pc(0.975,t),\n pc(0.99,t),\n pc(0.995,t),\n pc(0.999,t),\n pc(0.9995,t)\n ]\n ", "parameters": [["t", "number"]]}}, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "v1", "maxValue": "v1", "marks": 1}], "type": "gapfill", "prompt": "$\\operatorname{t}_{\\var{t}}(\\var{precround(1-p[u1],3)}) =\\;$?[[0]]
\n", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "v2", "maxValue": "v2", "marks": 1}], "type": "gapfill", "prompt": "
$\\operatorname{t}_{\\var{tn}}(\\var{precround(1-p[u2],3)}) =\\;$?[[0]]
\n", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "v3", "maxValue": "v3", "marks": 1}], "type": "gapfill", "prompt": "
$\\operatorname{t}_{\\var{tm}}(\\var{precround(1-p[u3],3)}) =\\;$?[[0]]
\n", "showCorrectAnswer": true, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "
Use statistics tables or R to find the following:
\n", "tags": ["checked2015", "critical values", "one-sided", "statistics", "student", "student ", "t statistics", "t tables", "t test", "tables", "unused"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "
27/01/2013:
\nTo be looked at again. Advice tables to be updated.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Looking up t-tables.
"}, "advice": "a)
\n{table([cr(t)],per)}
\nb)
\n{table([cr(tn)],per)}
\nc)
\n{table([cr(tm)],per)}
"}, {"name": "2012 2013 CBA4_3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [], "variables": {"le": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10,5,1,0.1)", "name": "le", "description": ""}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol", "description": ""}, "tr": {"group": "Ungrouped variables", "templateType": "anything", "definition": "round(r11-st*sd/sqrt(n))+pert", "name": "tr", "description": ""}, "st": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(studenttinv(1-le/200,n-1),3)", "name": "st", "description": ""}, "sd": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(5..12#0.2)", "name": "sd", "description": ""}, "test": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround((r11-tr)*sqrt(n)/sd,3)", "name": "test", "description": ""}, "mu": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(50..80)", "name": "mu", "description": ""}, "n": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..40#2)", "name": "n", "description": ""}, "isthis": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm[0]=0,'is less than ',' is greater than ')", "name": "isthis", "description": ""}, "mm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "switch(abs(test)<=st,[0,1],[1,0])", "name": "mm", "description": ""}, "pert": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(round(-2*st*sd/sqrt(n))..round(2*st*sd/sqrt(n)))", "name": "pert", "description": ""}, "that": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(mm[0]=0,' not significant and cannot reject the null hypothesis at the $\\\\var{le}$% level.', \n 'significant and can reject the null hypothesis at the $\\\\var{le}$% level.')\n ", "name": "that", "description": ""}, "r11": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(mean(repeat(normalsample(mu,sd),n)),1)", "name": "r11", "description": ""}}, "ungrouped_variables": ["le", "that", "mm", "r11", "tr", "n", "mu", "isthis", "tol", "pert", "test", "st", "sd"], "rulesets": {}, "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "test-tol", "maxValue": "test+tol", "marks": 1}], "type": "gapfill", "prompt": "Calculate the t-statistic you will need to test the null hypothesis:
\nTest statistic $t=\\;$?[[0]] (to 3 decimal places).
\n", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "st-tol", "maxValue": "st+tol", "marks": 1}], "type": "gapfill", "prompt": "
What is the critical value with which to compare $|t|$
\nCritical value $=\\;$[[0]] (to 3 decimal places, the answer should be positive)
", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["Yes
", "No
"], "matrix": "mm", "distractors": ["", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "displayColumns": 0, "marks": 0}], "type": "gapfill", "prompt": "Is the test significant?
\n[[0]]
", "showCorrectAnswer": true, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "$X_1,\\;X_2,\\;\\dots, X_n$ is a random sample from $\\operatorname{N}(\\mu,\\sigma^2)$.
\nThe sample size is $n=\\var{n}$, with sample mean $\\bar{x}=\\var{r11}$ and $s=\\var{sd}$, the sample standard deviation.
\nSuppose we wish to test at the $\\var{le}$% level the null hypothesis $H_0: \\mu=\\var{tr}$ versus a two sided alternative hypothesis.
\n", "tags": ["MAS2302", "Normal distribution", "checked2015", "confidence level", "critical value", "mean ", "normal distribution", "null hypothesis", "random sample", "sample", "sample mean", "sample standard deviation", "siginicant", "t test", "tables"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t
27/01/2013:
\n \t\tFirst draft completed.
\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "For a sample of size n from a normal distribution, given mean of the sample mean and the standard deviation , find the t-statistic corresponding to a null hypothesis $\\mu=m$ and a given confidence level. Check if the result is significant at this level.
"}, "advice": "The test statistic is given by:
\n\\[t = \\frac{\\bar{x}-\\mu}{\\frac{s}{\\sqrt{n}}}\\]
\nand in this case we have:
\n\\[t = \\frac{\\var{r11}-\\var{tr}}{\\frac{\\var{sd}}{\\sqrt{\\var{n}}}}=\\var{test}\\] to 3 decimal places.
\nNow look up in the tables the critical value at $\\var{le}$% for $\\var{n}-1=\\var{n-1}$ degrees of freedom and a two-sided test.
\nNote that as we are using one-sided tables we have to look at the $1-\\var{le}/200=\\var{1-le/200}$ critical value and find the corresponding value.
\nIn this case it is $\\var{st}$ to 3 decimal places.
\nSince $\\var{abs(test)}$ {isthis} $\\var{st}$ we see that the result is {that}.
\n"}, {"name": "20122013 CBA4_1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "p1", "showCorrectAnswer": true, "marks": 1, "maxValue": "p1"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "
$\\operatorname{P}(T \\lt \\var{v1})$ where $T \\sim t_{\\var{t}}$
\n$\\operatorname{P}(T \\lt \\var{v1})=\\;$?[[0]]
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "p2", "showCorrectAnswer": true, "marks": 1, "maxValue": "p2"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\operatorname{P}(T \\lt \\var{-v2})$ where $T \\sim t_{\\var{tn}}$
\n$\\operatorname{P}(T \\lt \\var{-v2})=\\;$ [[0]]
", "marks": 0}, {"scripts": {}, "gaps": [{"showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "minValue": "p3", "showCorrectAnswer": true, "marks": 1, "maxValue": "p3"}], "type": "gapfill", "showCorrectAnswer": true, "prompt": "$\\operatorname{P}(T \\gt \\var{v3})$ where $T \\sim t_{\\var{tm}}$
\n$\\operatorname{P}(T \\gt \\var{v3})=\\;$?[[0]]
", "marks": 0}], "variables": {"u2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10 except u1)", "name": "u2", "description": ""}, "p1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "p[u1-1]", "name": "p1", "description": ""}, "p3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(1-p[u3-1],3)", "name": "p3", "description": ""}, "t": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30)", "name": "t", "description": ""}, "per": {"group": "Ungrouped variables", "templateType": "anything", "definition": "['DF','0.75','0.800','0.850','0.900','0.950','0.975','0.990','0.995','0.999','0.9995']", "name": "per", "description": ""}, "p2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(1-p[u2-1],3)", "name": "p2", "description": ""}, "u3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10 except [u1,u2])", "name": "u3", "description": ""}, "v1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(t)[u1]", "name": "v1", "description": ""}, "u1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10)", "name": "u1", "description": ""}, "tn": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30 except t)", "name": "tn", "description": ""}, "p": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[0.75,0.8,0.85,0.9,0.95,0.975,0.99,0.995,0.999,0.9995]", "name": "p", "description": ""}, "v2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(tn)[u2]", "name": "v2", "description": ""}, "tm": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30 except[t,tn])", "name": "tm", "description": ""}, "v3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cr(tm)[u3]", "name": "v3", "description": ""}}, "ungrouped_variables": ["p2", "p3", "p1", "v1", "u1", "per", "u2", "tn", "p", "v2", "tm", "t", "u3", "v3"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"pc": {"type": "number", "language": "jme", "definition": "precround(studenttinv(p,n),3)", "parameters": [["p", "number"], ["n", "number"]]}, "cr": {"type": "list", "language": "jme", "definition": "[t,\n pc(0.75,t),\n pc(0.8,t),\n pc(0.85,t),\n pc(0.9,t),\n pc(0.95,t),\n pc(0.975,t),\n pc(0.99,t),\n pc(0.995,t),\n pc(0.999,t),\n pc(0.9995,t)\n ]", "parameters": [["t", "number"]]}}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Use statistics tables or R to find the following:
\n", "tags": ["MAS2302", "checked2015", "critical values", "one-sided", "statistics", "student", "student ", "t statistics", "t tables", "t test", "tables"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "
27/01/2013:
\nFirst draft completed.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Looking up t-tables.
"}, "advice": "\n
a)
\nWe have to find $\\operatorname{P}(T \\lt \\var{v1})$ where $T \\sim t_{\\var{t}}$.
\nLooking at the tables for degrees of freedom $\\var{t}$ ,
\n{table([cr(t)],per)} we see that the value $\\var{v1}$ corresponds to the $\\var{p1}$ critical point, and since the tables are one sided we see that $\\operatorname{P}(T \\lt \\var{v1})=\\var{p1}$
\n\n
b)
\nWe have to find $\\operatorname{P}(T \\lt \\var{-v2})$ where $T \\sim t_{\\var{tn}}$. Looking at the table for degrees of freedom $\\var{tn}$ ,
\n{table([cr(tn)],per)} we see that since the tables are one sided,
\n$\\operatorname{P}(T \\lt \\var{-v2})=\\operatorname{P}(T \\gt \\var{v2})=1-\\operatorname{P}(T \\lt \\var{v2})=1-\\var{precround(1-p2,3)}=\\var{p2}$
\nc)
\nWe have to find $\\operatorname{P}(T \\gt \\var{v3})$ where $T \\sim t_{\\var{tm}}$. Looking at the table for degrees of freedom $\\var{tm}$ ,
\n{table([cr(tm)],per)} we see that since the tables are one sided,
\n$\\operatorname{P}(T \\gt \\var{v3})=1-\\operatorname{P}(T \\lt \\var{v3})=1-\\var{precround(1-p3,3)}=\\var{p3}$
", "showQuestionGroupNames": false}], "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Questions used in a university course titled \"Statistical inference\""}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}