Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions