Standard Normal Distribution - Function Perform a Simple test on the Sample - Engineering Assignment Help

Download Solution Order New Solution
Assignment Task:

Instructions: In one file, write programs for the tasks below and upload the file (.py) to Blackboard. In the top comments section of the file, please include your name, the date, and the assignment number. While you do not have to add comments for every line of code, please include comments to tell a reader what you are doing. Commenting your code also suggests to me that you know what you are doing.
While there is no one way to do things, your code should only use commands and methods from class. I do not want you using other commands that you got from the internet.
Also use the #%% command to divide each answer into its own cell. Note also include #%% after the last line of code in the program.
Today, when most people by a house they take a 30-year fixed-rate mortgage. They put a down payment (usually 20% of the purchase price) and each month for 30 years they pay a fixed monthly payment. Each payment contains some combination of the principal (the loan) and interest.

Create a function that inputs the total value of a house, the percent of the down payment (thus the loan amount is house value – fraction down*house value, the (annual) interest rate, the number of years, and returns the MONTHLY payment. So, inputs are interest rate (in annual percentage terms, e.g. 6%), total house price in dollars (e.g. 500000) and percent down payment (e.g. 20%). You need to convert interest rate and payment length to monthly rates. 

Then have a user input a house price, a down payment rate, assume a 5% annual interest, and then return the monthly payment and the fraction of a person’s total income for house payments, assuming they earn $100,000 per year.

Write a function that does the following. 

Inputs, n, the number of trials for a binomial process (e.g. # of coin flips) from a binomial distribution (set prob of success always to be .5. For example, of n=100, it will give k, the number of successes or head from n trial.
Then for n=100 trials, call the function 20 times. That is, generate an array of 20 k-values, where k is the number of “successes” or “heads” from 100 “picks” or “flips”.
[Note the way to think of this is as follows. Imagine you had 20 bags of coins, and each bag contains many, many coins. You go to the first bag and pick 100 coins and count the number of heads you get. Then you go to the next bag and pick 100 coins and count the number of heads. Then you go to third bag and pick and so on, until you pick coins from the last bag. In this way, you will have for each bag the number of heads.
Then print out the mean and standard deviation from this array of k’s. What should the average of k be in reality? How far away is your sample mean and what does the standard deviation suggest about how much variation there is in the array of k’s

Write a function that inputs the, n, the number of random trials for a standard normal distribution and then generates an array of n random observations (ie generate a random sample of n observations from a N(0,1) distribution. Then have the function perform a simple t-test on the sample, testing the null hypothesis that is mean 0. Have the function return two things: the results of the ttest and another variable that is set to the string= “reject” if the p-value is less than .1, and “not” if otherwise. Then call the function 20 times for n=25 and generate a new list that appends “reject” or “not reject” for each test. Comment on whether there is any rejection of the null or not and why this might be.

Generate an array with 100 observations of a variable from a uniform distribution between -5 and 5, call this x1. Generate a second array with 100 from a uniform distribution between 0 and 20. Generate a third array, call it e1 , which is 100 randomly generated observations form a standard normal distribution (Normal dist. with mean 0 and st. dev10). Generate a fourth variable Y = 2 - 3x1 + 4x2 + e1. Using linalg in numpy run a regression to get estimates of the intercept and two slope coefficients. Comment on how close or far away the estimates are from the true model and why that might be so.
 

This Engineering Assignment has been solved by our Engineering Experts at onlineassignmentbank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.