We will be using your NormPDF function for two of these exercises. Define that function here....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
part b To test the MyMoments function using the mpgcsv file you can follow these steps in Python 1 I... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The stock is currently selling for $15.25 per share, and its noncallable $1,000 par value, 20-year, 7.25% bonds with semiannual payments are selling for $875.00. The beta is 1.25, the yield on a...
-
The purpose of this project is to work more with lists, looping, file I/O, functions, and dictionaries. For this assignment, you will work with real data from the web. Background Major solar storms...
-
One of the benefits of using computers to solve problems is they can process data very quickly to help us discover important facts about the real world. In this part of the lab, we will be using...
-
You are to show the journal entries necessary to record the following items which occured in 2012: (a) May 1 Bought a van on credit from Deedon Garage for 6,000. (b) May 3 A debt of 100 owing from P....
-
3M Company reported the following financial data for 2009 and 2008 (in millions). Instructions(a) Calculate the current ratio for 3M for 2009 and 2008.(b) Suppose that at the end of 2009, 3M...
-
An AGVS will be used to satisfy material flows indicated in the from-to Chart in the table below, which shows deliveries per hour between stations (above the slash) and distances in meters between...
-
What is transpiration? How does transpiration drive the movement of water up the xylem?
-
On December 1, Blue Mountain Production Inc. had a work in process inventory of 1,200 units that were complete as to materials and 50% complete as to labor and overhead. December 1 costs follow:...
-
Jeffrey Pfeffer (1998b) wrote in his article on Six dangerous myths about pay in the Harvard Business Review: People do work for money but they work even more for meaning in their lives. In fact,...
-
Zim Company uses the following cost function: Y = $4200 + $5.25X. If the number of units produced in a month is 100, what would be the total cost?
-
You have been commissioned (paid!) to determine the concentration of particulate matter being emitted from a stack at a pulp mill. The total volumetric flow rate of the stack gas (at stack...
-
Two ice skaters, with masses of 45 kg and 85 kg , are at the center of a 50 m -diameter circular rink. The skaters push off against each other and glide to opposite edges of the rink. If the heavier...
-
2. Bob bought some land costing $16,040. Today, that same land is valued at $46,117. How long has Bob owned this land If the price of land has been Increasing at 4 percent per year?
-
FIND ANY ONE COMTEMPARY ISSUE IN THE REGULATORY SECTOR OF GHANA PUBLISHED IN THE PAPERS FROM 1957 TILL 2010 WHICH IS RECURRENT OR STILL RELEVANT TODAY. STATE 5 REASONS WHY IT IS STILL RELEVNT OR...
-
Does morality have any role to play in criminal law? Explain the relationship between morality and criminal law?
-
You want to purchase some shares of JJ Farms stock but need a rate of return of 17.5 percent to compensate for the perceived risk. What is the maximum you are willing to pay per share for this stock...
-
Project Objective The assignment/mini-project allows students to demonstrate their acquired knowledge and skills throughout the course - Introduction to Web Technology. The required tool in...
-
A. Select a recent issue (paper or online) of Report on Business Magazine, Canadian Business Magazine (online only), Bloomberg Businessweek, Fast Company, The Economist, or another business magazine....
-
Calculate the amount of the child and dependent care credit allowed for 2012 in each of the following cases, assuming the taxpayers had no income other than the stated amounts. a. William and Carla...
-
Sherry Hopson owns a retail family clothing store. Her store is located at 4321 Circle Drive, Houston, TX 77001. Her employer identification number is 95- 1234321 and her Social Security number is...
-
Greg died on July 1, 2012, and left Lea, his wife, a $50,000 life insurance policy which she elects to receive at $5,000 per year plus interest for 10 years. In the current year, Lea receives $6,200....
-
a. Express the signal in terms of unit-step functions. b. Find the Laplace transform of the expression in (a) by using the shift on \(t\)-axis. \(g(t)\) in Figure 2.15 FIGURE 2.15 Signal in Problem...
-
a. Express the signal in terms of unit-step functions. b. Find the Laplace transform of the expression in (a) by using the shift on t -axis. \(g(t)= 0 if t <0 1-t if 0 1
-
a. Express the signal in terms of unit-step functions. b. Find the Laplace transform of the expression in (a) by using the shift on \(t\)-axis. \(g(t)= 0 if t <0 t if 0 1
Study smarter with the SolutionInn App