Question: The probability density function for a normal distribution (bell curve) with mean and variance 2 is given by f(x)=21e22(x)2,xR,R,2>0. (a) Write an R function called

 The probability density function for a normal distribution ("bell curve") with

The probability density function for a normal distribution ("bell curve") with mean and variance 2 is given by f(x)=21e22(x)2,xR,R,2>0. (a) Write an R function called mdnorm1 that computes f(x) for any value of x, and . (b) Copy the function in (a) and call it mdnorm2. Set the defaults for and to be 0 and 1 respectively. (c) Copy the function in (b) and call it mdnorm3. Add a new input called log that defaults to FALSE. If FALSE return f(x) otherwise return lnf(x). Make sure you first simplify the expression returned when TRUE. Submit your R code as q3.R. Also, please label each part (a)-(c) with a comment like you did for question 1 )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!