Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2. (4 marks). The generalised mean {with exponent is? > U) of a random variable X is dened as: (we)? where E (X k}
Question 2. (4 marks). The generalised mean {with exponent is? > U) of a random variable X is dened as: (we)? where E (X k} is the expected value of X k. The generalised mean generalises several measures of centralit}r into one (for example, if I: = 1, then the usual expected value is obtained). (a) \"trite code for an R function generalisedaean which takes as input three variables: events. probabilities and k, and returns the generalised mean with exponent is (as per the above definition) based on these values. The variable events is assumed to be a vector containing the events in the sample space of a discrete random variable X , and the variable probabilities is assumed to be a vector containining the respective probability of each event. You can make use of the expected.value function from the W'eek 2 Lab class in your code. You may also nd it helpful to model your solution on the functions in this lab. (b) Use your function to verify that the generalised mean with exponent k = 2 of the random variable X in Question 1 is approximately 6.162. For your interest: the generalised mean with. exponent 2 is speeieatiy known as the root mean square of the random variable. For Question 2, submit the code you write for part {a}, and the commands used to evaluate part (b)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started