Question: We will be using your NormPDF function for two of these exercises. Define that function here. Python Julia Exercise 1 (Either R, Python or

We will be using your NormPDF function for two of these exercises.

We will be using your NormPDF function for two of these exercises. Define that function here. Python Julia Exercise 1 (Either R, Python or Julia) Part a. Write a function My Moments to compute mean, standard deviation, skewness and kurtosis from a single vector of numeric values. You can use library mean functions, but should use one (and only one) for loop to compute the rest. Note that computationally efficient implementations of moments take advantage of (Y-Y)= (Yi-Y) x (Yi-Y), etc. See https://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm for formula for skewness and kurtosis. This reference gives several definit wness and kurtosis, you only need to implement for both one formula for each. Note that for computing skewness and kurtosis, standard deviation is computed using N as a divisor, not N - 1. Your function should return a list or a tuple with Mean, SD, Skewness and Kurtosis. Your function should check for missing values, and accumulate sums only if values are non-missing. You might need to pass arguments to specify how to handle missing values if you use library functions to compute a mean (na.rm in R, nanmean in numpy or skipmissing in Julia) R Python Julia Part b. Test your function by computing moments for MPG from the file mpg.csv. This file will be available on D2L under Week 5 Lecture Materials. Note that there are missing values in this column, so will be testing your functions ability to process a vector with missing values. R Python Julia If you wish, compare your function results with the skewness and kurtosis in the R moments package (you may need to use na.rm=TRUE), or the skew and kurtosis functions from scipy.stats (you may need to call .to_list() and use nan_policy='omit'), or the StatsBase functions skewness and kurtosis in Julia (You may need to use collect (skipmissing (...)). Note that some functions may return excess kurtosis (Pearson's kurtosis minus 3). R 1 Python Julia

Step by Step Solution

3.43 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

part b To test the MyMoments function using the mpgcsv file you can follow these steps in Python 1 I... View full answer

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 Programming Questions!