Suppose we have a dataset DD in a regression problem. What will happen to the in-sample...

Suppose we have a dataset DD in a regression problem.

  1. What will happen to the in-sample error of linear regression using polynomials of degree dd as d→∞d→∞?

  2. What will happen to the out-of-sample error of linear regression as dd increases?

You can use the output of the code below to help you form your answer.

CODE BELOW:

xmin,xmax = 0,4*np.pi
x = np.linspace(xmin,xmax,1000)
D = 14

N = 100
shuff = np.random.permutation(len(x))
x_pts = np.array(sorted(x[shuff][:N]))

K = 200
train_vals = np.zeros(D*K).reshape(K,D)
test_vals = np.zeros(D*K).reshape(K,D)
noise = np.random.randn(N)
y = np.sin(x_pts)+ noise/7

for k in range(K):
    shuff = np.random.permutation(len(x))
    x_pts = np.array(sorted(x[shuff][:N]))
    noise = np.random.randn(N)
    y = np.sin(x_pts)+ noise/7
    for i,deg in enumerate(range(D)):
        X = np.ones(N*deg).reshape(N,deg)
        for j in range(1,deg):
            X[:,j] = x_pts**j
        X_train,X_test,y_train,y_test = test_train_split(X,y,0.13)

        w = linear_fit(X_train,y_train)

        g_train = linear_predict(X_train,w)
        g_test = linear_predict(X_test,w)

        r_train = RMSE(g_train,y_train)
        r_test = RMSE(g_test,y_test)
        train_vals[k][i] = r_train
        test_vals[k][i] = r_test

tr_vals = np.mean(train_vals,axis=0)
te_vals = np.mean(test_vals,axis=0)

plt.plot(range(D),tr_vals)
plt.title("In sample error as a function of model complexity")
plt.xlabel("Polynomial degree")
plt.ylabel("RMSE")
plt.show()
plt.title("Out of sample error as a function of model complexity")
plt.plot(range(D),te_vals)
plt.xlabel("Polynomial degree")
plt.ylabel("RMSE")

plt.axis([0,D,0,2])
plt.show()

In: Computer Science

The purpose of this discussion activity is two-fold. The first is to give you (and me)...

The purpose of this discussion activity is two-fold. The first is to give you (and me) a chance to get to know one another, and the second is to share our ideas around the social determinants of health and how this may impact on our consumers of healthcare.

You are required to post a response to the following questions:

1. What is your name?

2. What is your favourite hobby/past time?

3. From your work this week list one of the key social determinants of health

4. For that social determinant of health describe how this may impact on a consumers health and wellbeing.

Please try to keep your responses to a max of 300 words. This will help keep you focused and concise and won't create hours of reading for your peers. As part of this task you must use at least 3 references to support your information and reference using APA 7th Edition.

In: Nursing

Draw a picture illustrating the following fact pattern: Company A is exchanging its patent for a...

Draw a picture illustrating the following fact pattern: Company A is exchanging its patent for a building in Michigan, plus $750,000 cash, from Company B. Company B has taken out a loan for $750,000 from Sub Bank in anticipation of the exchange. Sub Bank is a wholly owned subsidiary of Parent Bank.

In: Accounting

The Black Langshan chicken breed has feathered legs. When Black Langshan chickens are crossed with Bluff...

The Black Langshan chicken breed has feathered legs. When Black Langshan chickens are crossed with Bluff Rock chickens, which have unfeathered legs, all F1 has feathered legs. In the F2 only 24 out of 360 individuals have unfeathered legs while 336 chickens have feathered legs. (a) What type of gene interaction controls this phenotype? (b) Test your hypothesis using chi-square analysis.

In: Biology

Pls decode the following question and then solve it. O BR DNOCQOCM FL B DNTII KMOD...

Pls decode the following question and then solve it.

O BR DNOCQOCM FL B DNTII KMOD CGRJIT. WNIC WTODDIC OC JBUI IOMND, DNI CGRJIT UDOEE NBU DNTII KOMODU, JGD DNIY BTI IXBADEY DNI TIVITUI FL ODU JBUI DIC TIHTIUICDBDOFC. WNBD OU DNI CGRJIT?

Note: all the signle letter = I or A

In: Computer Science

1. If the 4-bit two's complement representations of integers J and K are 0100 and 1001,...

1. If the 4-bit two's complement representations of integers J and K are 0100 and 1001, respectively, then the decimal representation of integer (J - K) (K subtracted from J) is

  1. 11
  2. -2
  3. 2
  4. -3
  5. other (state the number)

2. The "correctness" core quality of software refers to the fact that ...

  1. programs efficiently support the insertion of new features, improvements, corrections
  2. programs answer to requested user actions within acceptable time delays.
  3. programs compile without any syntax errors.
  4. programs accurately meet the specifications of behaviour and required outputs

3. Running class TwoDSum, whose code is:

public class TwoDSum {
   public static void main(String[] args) {
      int[][] table = {-1,7,-3},{0,2,-4},{9,-6,5};
      int sum = 0;

      for (int i = 0; i < table.length; i++)
         if (i != table.length - i)
            sum += table[i][i] + table[table.length - i-1][i];

      System.out.println("Sum is " + sum);

   }
}

will display on the user console ...

  1. Sum is 14
  2. Sum is 20
  3. Sum is -2

4. The code of class Det below:

public class Det {
   public static void main(String[] args) {
      int[][] a = new int[2][];
      a[0] = new int[2];
      a[1] = new int[2];
      a[0][0] = 2;
      a[0][1] = 1;
      a[1][0] = 5;
      a[1][1] = 3;
      int det = a[0][0]*a[1][1] - a[0][1]*a[1][0];

      System.out.println("Determinant is " + det);
   }
}

will ...

  1. display "Determinant is 1" on the user console.
  2. issue a "missing ]" compilation error
  3. display "Determinant is 11" on the user console

5. Given the two code fragments A) an B), below, to compute the final value of a variable grandTotal, of type double and a 0 initial value:

A)

double delta = 0.1;

for (int i=0; i<10000; i++)

    grandTotal += delta;

B)

double delta = 0.001;

for (int i=0; i<1000000; i++)

    grandTotal += delta;

Then variable grandTotal is...

  1. Both code fragments, A and B, compute grandTotal without any round-off error
  2. Computed with less round-off error in code fragment A
  3. Computed with less round-off error in code fragment B

6. An interface...

  1. Cannot be extended.
  2. can be used as a type in the instantiation/declaration line of an anonymous class.
  3. Cannot be implemented by an abstract class.

In: Computer Science

18) Which types of misbehavior in research are punishable by grant-giving agencies, and why? 19) What...

18) Which types of misbehavior in research are punishable by grant-giving agencies, and why?

19) What is “science the endless frontier”? Who suggested this, when, and why?

20) What happened in 1973 that was relevant for university-industry relations?

21) What is the Bayh-Dole act and what is its significance?

In: Psychology

I plan on retiring at 70 years of age, I want to retire with a net...

I plan on retiring at 70 years of age, I want to retire with a net income of $105,000 a year, total. I anticipate that social security will fund $20,000 of this total, but the social security will be taxable at 25%. The other portion is a ROTH IRA and not taxable at retirement.

How much will I need to have earned to fund this retirement at age 70 if I believe that I can retire for 30 years, to age 100, (no money left at 100, so it will be an annuity type investment, not perpetuity). I plan on earning 3.9% on my nest egg, or retirement savings for those 30 years. (lump sum). Round to the nearest dollar.

In: Finance

What happens if an established energy-drink company decides to enter the antienergy space? How does the...

What happens if an established energy-drink company decides to enter the antienergy space? How does the marketing game change for a company like Slow Cow

In: Economics

In reverse osmosis, water flows out of a salt solution until the osmotic pressure of the...

In reverse osmosis, water flows out of a salt solution until the osmotic pressure of the solution equals the applied pressure. If a pressure of 48.0 bar is applied to seawater, what will be the final concentration of the seawater at 20

In: Chemistry

- Please Provide an analysis from the economic point of view on the demand of the...

- Please Provide an analysis from the economic point of view on the demand of the Amazon kindle based on this article, Thanks

Amazon New Kindle Fire Versus Apple iPad

Apple’s iPad has so dominated the tablet-computer market that one Silicon Valley venture capitalist recently told me that “there is no tablet market—there is an iPad market, and then some hangers-on.”

But all that just changed with the introduction of the new Amazon Kindle Fire, a seven-inch tablet that costs only $199—less than half the price of the entry-level iPad, which boasts a 9.7-inch screen and costs $499.

Amazon CEO Jeff Bezos introduced the Kindle Fire at a lavish event in New York City, where he described it as “an unbelievable value.” “We’re building premium products at nonpremium prices,” he said.

The Kindle Fire, which will ship Nov. 15, boasts some clever touches, including a speedy new Web browser that Amazon’s engineers invented.

Amazon in the past has downplayed its rivalry with Apple, saying that Kindle and iPad were meant for different kinds of users.

But now the battle has shifted into open warfare, with Bezos even mocking Apple for forcing users to sync their iPads by connecting the device to a computer with a cable, calling that “a broken model.”

In other words, make no mistake: this is war. And the stakes could not be higher. Amazon and Apple are fighting to see who will control the world of digital media.

Amazon began on the content side, and Apple began on the device side. But now they’ve met in the middle.

Unlike all of the other tablets that have tried (and failed) to compete against the iPad, the Kindle Fire comes with the same secret weapon that has made the iPad such a hit: immediate access to an electronic store selling digitized books, movies, and music.

The Kindle Fire comes loaded with software that lets you buy digital content from Amazon with the click of a button. You can think of it as a digital shopping cart that lets you scan the shelves at Amazon and grab whatever you like.

Another plus: Whatever content you buy is automatically backed up in Amazon’s cloud servers. You can delete it and get it back whenever you want. Unlike the iPad, which has to be synced to a computer via a cable, the Kindle Fire syncs wirelessly.

Since the Kindle Fire runs Google’s Android operating system, it can download apps from Amazon’s Android App store. Amazon also introduced a speedy new Web browser, called Amazon Silk, that splits work into two pieces—a lot gets done on Amazon’s servers, and a little gets done on the device itself, the result being that pages flash up really quickly.

Another clever move is that Amazon has tied Kindle Fire to its Prime service, which for $79 a year lets customers get free shipping on packages and free streaming of movies and TV shows from Amazon. Buy a Kindle Fire and you get a 30-day free trial subscription to Prime.

There are still some shortcomings. The Kindle Fire has no camera or microphone, and can only work on WiFi, as it lacks support for 3G networking. The Kindle Fire comes with only 8 gigabytes of memory, versus 16 for the low-end iPad—but Amazon lets you store any content you purchase on its servers, at no charge.

Tim Bajarin, president of Creative Strategies, a Silicon Valley research firm, calls the Kindle Fire “a game changer” and says it will be “an important product for Amazon and for the industry.”

But Bajarin says the smaller screen on the Kindle Fire makes it unable to really compete against the iPad. “This is not an iPad killer,” Bajarin says. “There is no such thing.”

Bajarin says the Kindle Fire will appeal to people whose main use for a tablet involves reading books and who consider computer-like functions (email, Web browsing) and movie watching to be secondary needs.

Amazon’s previous Kindles have been smaller, simpler devices, with black-and-white screens meant only for reading. They use E Ink, a technology that is great for reading text, even in direct sunlight, and also uses very little battery power.

Until today Kindle prices started at $114, but now Amazon has slashed the price of a basic Kindle to $79. Amazon also introduced today the Kindle Touch, a black-and-white Kindle with a touchscreen that sells for $99, and the Kindle Touch 3G, which has free 3G wireless service and costs $149.

Amazon won’t say how many Kindles it has sold, but in the past the company has claimed Kindle was the top-selling electronic device in its store.

The first Kindle came out in 2007. It was the coolest gadget around—until the iPad arrived in 2010 and became a smash hit. The iPad 2 shipped in March of this year, adding a camera and a faster processor. Apple has sold nearly 30 million iPads so far, and since it came out Amazon has tried to market the Kindle by touting the virtues of its black-and-white screen, which is easier on the eyes than the bright, back-lit LCD screen on the iPad.

The argument was that iPad was great for browsing the Web or watching a movie, but nobody would read a novel on it because their eyes would get sore. Somehow, a lot of people seem not to care, and are happy to read books on an iPad.

Pundits have long expected that Amazon would roll out a full-color tablet. The newly announced seven-inch model may just be a start. Some analysts expect Amazon to introduce a bigger tablet, one more comparable to the iPad, sometime in the next year.

Can the Kindle Fire—this one, or a larger version in the future—really become a credible rival to Apple’s iPad? Can it escape the fate that has doomed other iPad-wannabes, from Samsung, Motorola, and Research in Motion to HP?

Investors seem to think so. Amazon shares were up $5, to $229, Wednesday morning on the news of the launch. Whether customers will react with as much enthusiasm remains to be seen.

As for me, I’m going to place my pre-order as soon as I click “send” on this story.

In: Economics

You are a primary researcher. Select a topic of interest. Form a research question that you...

You are a primary researcher. Select a topic of interest. Form a research question that you will ask 25 people. The question should generate a range of quantitative data. Some examples are: “ On average, how many minutes a day do you spend texting?” or “ How many inches tall are you?” Note: Research question should start with “How often...” or, “On average, how many...” Do not ask a question like, “Do you like chocolate?” because responses are “yes” or “no . ” You need numbers. Note: Be specific. Do not ask “How many bottles of water do you drink?” Instead ask, “On average, how many 8 -oz. glasses of water do you drink in a day?” You need to collect numerical data. Your question should be clear, concise and unbiased. Part of your Discussion Board posting this week will be your research question. Your research question must be approved by instructor. Required: 1. List your raw data results in a column in Excel. 2. Construct a relative frequency distribution of your data. Remember each class should have the same width, for example class es of 0 to 5, 6 to 10, 11 to 15 etc. 3. Using Excel, calculate the mean and standard deviation of your distribution and interpret their meanings. 4. Calculate a 95 percent confidence interval for the mean of your distribution using the t-distribution and your sample standard deviation. 5. Comment on your results – what have you observed? This is important so think and write carefully Format: Use Excel Worksheets and text dialog boxes where appropriate with size 12 font.

In: Math

Suppose the productivity of capital and labour are as shown in the accompanying table. The output...

Suppose the productivity of capital and labour are as shown in the accompanying table. The output of these factors sells in a perfectly competitive market for $1 per unit. Both capital and labor are hired under perfectly competitive conditions at $15 and $10, respectively.

K MPK L MPL
0 0
1 30 1 21
2 27 2 18
3 24 3 15
4 21 4 12
5 18 5 9
6 15 6 6
7 12 7 3
8 9 8 1

a. What is the least‐cost combination of labour and capital the firm should employ in producing 96 units of output? Explain.

b. What is the profit‐maximizing combination of labor and capital the firm should use? Explain. What is the resulting level of output? What is the economic profit?

In: Economics

1. Is acetyl salicylic acid able to go from aqueous to organic solution under acidic conditions?...

1. Is acetyl salicylic acid able to go from aqueous to organic solution under acidic conditions? What about basic conditions?

Expain

2. is apririn more likely to pass through the hydrophilic cell membrane in the stomach or in the small intestine?

Provide a reason

Thank You

Will rate

In: Chemistry

How many of the following chemical formulas for the following species have an incorrect name listed?...

How many of the following chemical formulas for the following species have an incorrect name listed? chemical formula name [Pt(H2O)4][PtCl6] tetraaquaplatinum(Ⅱ) hexachloroplatinate(Ⅳ) [Cu(NH3)4]Cl2 tetraamminecopper(Ⅱ) chloride [Co(H2O)4(NH3)(OH)]Cl2 amminetetraaquahydroxocobalt(Ⅲ) chloride Na3[RhCl6] sodiumrhodium(Ⅲ) hexachloride

In: Chemistry