2. [10 marks] The k-means algorithm is widely used in cluster analysis for its simplicity. Since...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. [10 marks] The k-means algorithm is widely used in cluster analysis for its simplicity. Since sample means can be severely affected by outliers, one may want to replace sample means with sample medians as cluster centers and thus obtain the following k-means algorithm based on medians for univariate data (perhaps we can call it the "k-medians algorithm"): Given k initial cluster centers c₁,...,Ck for a sample 21,...,n, repeat the following two steps until cluster centers do not change: (1) Calculate dij = ₁-C₁| for i=1,...,n and j = 1,..., k. Classify x; into cluster m, if dim is the smallest of dil...., dik. (2) For j = 1,...,k, set c; = median(x) for all x; in cluster j. Implement the "k-medians algorithm" in an R. function which, given a univariate sample and an initial set of cluster centers (both in vectors), computes and returns the final cluster centers. Apply it to the variable eruptions (for eruption times of the well-known Old Faithful Geyser) in the data set faithful in R, using the following initial cluster centers, respectively: (a) (2, 4); (b) (2, 3, 4); (c) (2,3,4,5) 2. [10 marks] The k-means algorithm is widely used in cluster analysis for its simplicity. Since sample means can be severely affected by outliers, one may want to replace sample means with sample medians as cluster centers and thus obtain the following k-means algorithm based on medians for univariate data (perhaps we can call it the "k-medians algorithm"): Given k initial cluster centers c₁,...,Ck for a sample 21,...,n, repeat the following two steps until cluster centers do not change: (1) Calculate dij = ₁-C₁| for i=1,...,n and j = 1,..., k. Classify x; into cluster m, if dim is the smallest of dil...., dik. (2) For j = 1,...,k, set c; = median(x) for all x; in cluster j. Implement the "k-medians algorithm" in an R. function which, given a univariate sample and an initial set of cluster centers (both in vectors), computes and returns the final cluster centers. Apply it to the variable eruptions (for eruption times of the well-known Old Faithful Geyser) in the data set faithful in R, using the following initial cluster centers, respectively: (a) (2, 4); (b) (2, 3, 4); (c) (2,3,4,5)
Expert Answer:
Answer rating: 100% (QA)
a Final centers are 19830 and 43415 See the plot below showing ... View the full answer
Related Book For
Intermediate Accounting
ISBN: 978-1260481952
10th edition
Authors: J. David Spiceland, James Sepe, Mark Nelson, Wayne Thomas
Posted Date:
Students also viewed these accounting questions
-
The Payback method is widely used in capital budgeting because is its simple and does a good job of determining the correct accept/reject decision. 1. True 2. False
-
The molecule n-octylglucoside, shown here, is widely used in biochemical research as a nonionic detergent for "solubilizing" large hydrophobic protein molecules. What characteristics of this molecule...
-
The Heaviside function: is widely used in engineering applications. (See figure.) To print an enlarged copy of the graph, go to MathGraphs.com. Sketch the graph of each function by hand. (a) H(x) 2...
-
Plainbank has $10 million in cash and equivalents, $30 million in loans, and $15 in core deposits. a. Calculate the financing gap. b. What is the financing requirement? c. How can the financing gap...
-
Revise the following by incorporating a bulleted list. yellin Resources specializes in preemployment background reports. Among our background reports are ones that include professional reference...
-
Slim Corporations balance sheet at January 1, 20X7, reflected the following balances: Ford Corporation entered into an active acquisition program and acquired 80 percent of Slims common stock on...
-
Managements responsibility for the entitys compliance with compliance requirements includes the following: (a) Identifying the entitys government programs and understanding and complying with the...
-
Suppose selected financial data of Target and Wal-Mart for 2014 are presented here (in millions). Instructions (a) For each company, compute the following ratios. (1) Current ratio. (2) Accounts...
-
You have a choice between a municipal bond paying a 4 percent coupon and a corporate bond of the same risk rating paying a 5 percent coupon. If you are in the 40 percent marginal tax bracket, what is...
-
FOSSIL IDENTIFICATION KEY Identify the names of the two fossils? Select the names of the two unique fossils that you identified from the snapshots located on the Parv Bed, and then click "Submit...
-
Locate the exemption statutes of the state of Texas and compare them with the federal exemptions set forth in 522(d) of the Code. Which appears more generous to debtors? Which appears more reasonable...
-
Envelope Company began operations this month mass-producing pull-and-seal envelopes. During the month of July, it completed 25,000 units and has 20,000 units that are 65% complete. It had product...
-
In its first year of operations, Mary Corp. earned $ 6 1 , 2 0 0 in service revenue. Of that amount, $ 1 0 , 3 0 0 was on account and the remainder, $ 5 0 , 9 0 0 , was collected in cash from...
-
Agarwal, Bergeron, and Cishek have been in partnership for a number of years. The partners allocate all profits and losses on a 2 : 3 : 1 basis, respectively. Recently, each partner has become...
-
Compute the amount that can be borrowed under each of the following circumstances: ( PV of $ 1 , FV of $ 1 , PVA of $ 1 , and FVA of $ 1 ) Note: Use appropriate factor ( s ) from the tables provided....
-
Groro Company bills a client $ 6 9 , 0 0 0 for services provided and agrees to accept the following three items in full payment: ( 1 ) $ 2 0 , 0 0 0 cash, ( 2 ) $ 8 1 , 0 0 0 of equipment, and ( 3 )...
-
Question 2 For each bank reconciliation item, describe the appropriate action an accountant should take. If a journal entry is needed, please make one (assume a date of July 31st). Of three cheques...
-
Use critical values to test the null hypothesis H0: 1 2 = 20 versus the alternative hypothesis H0: 1 2 20 by setting a equal to .10, .05, .01, and .001. How much evidence is there that the...
-
Long-term obligations usually are reclassified and reported as current liabilities when they become payable within the upcoming year (or operating cycle, if longer than a year). So, a 25-year bond...
-
Johns Specialty Store uses a periodic inventory system. The following are some inventory transactions for the month of May: 1. Johns purchased merchandise on account for $5,000. Freight charges of...
-
Performance and profitability of a company often are evaluated using the financial information provided by a firm's annual report in comparison with other firms in the same industry. Ratios are...
-
In a theater, the first row has 24 seats. Each row after that has 2 more seats. How many total seats are there if there are 40 rows of seat in the theater?
-
In the following geometric sequences, determine the indicated term of the geometric sequence with a given first term and common ratio. 1. Determine the 12 th term of the geometric sequence with...
-
Sophia deposited \(\$ 4,000\) in an account that earns \(5.5 \%\) interest compounded yearly. After 20 years, Sophia withdrew all the money in the account to pay for her child's college. How much...
Organizational Behavior Real Solutions To Real Challenges 1st Edition - ISBN: 0078112788 - Free Book
Study smarter with the SolutionInn App