QuickHelper

(10)

$20/per page/

About QuickHelper

Levels Tought:
Elementary,High School,College,University,PHD

Expertise:
Accounting,Applied Sciences See all
Accounting,Applied Sciences,Business & Finance,Chemistry,Engineering,Health & Medical Hide all
Teaching Since: May 2017
Last Sign in: 352 Weeks Ago, 4 Days Ago
Questions Answered: 20103
Tutorials Posted: 20155

Education

  • MBA, PHD
    Phoniex
    Jul-2007 - Jun-2012

Experience

  • Corportae Manager
    ChevronTexaco Corporation
    Feb-2009 - Nov-2016

Category > Statistics Posted 25 Aug 2017 My Price 11.00

Complete the short assignment in SAS by editing the current code

 


Question description

 

  1. Read the assignment description in the attached PDF of the same name.
  2. Upload an MS Word or PDF file containing the roots of the polynomial x^3-3x^2+x-3 found by your user-defined function CUBIC.
  3. Upload code (.sas file) used to produce the print out in step 2.

Incase the file NEWTONS_METHOD Doesn't open, the code is here:

proc iml;
/** x##3 - 2 x##2 -4 x + 3 **/
q = {1, -2, -4, 3};

start eval(p,x,val);
N = NROW(p);
val = p[1];
do k = 1 to N-1;
val = val*x + p[k+1];
end;
finish eval;

start der(p,p_prime);
p_prime = J(NROW(p)-1,1,0);
do k = 1 to NROW(p) - 1;
p_prime[k] = (NROW(p)-k)*p[k];
end;
finish der;

start newton(q,x0,tol,root);
/* The value x0 is the initial estimate of the root.
The value tol is how close to zero the polynomial should be to for the current 
estimate to be accepted as a root.*/

call der(q,q_prime);
iter_max = 100;
xnext = x0;
do k = 1 to iter_max;
call eval(q,xnext,val_1);
if abs(val_1) < tol then k = iter_max;
call eval(q_prime,xnext,val_2);
xnext = xnext - val_1/val_2;
end;
root = xnext;
finish newton;

call newton(q,0,0.0001,r1);
print r1;

/*Try a different starting value ..*/

call newton(q, 2.5,0.0001,r2);
print r2;


call newton(q, -7,0.0001,r3);
print r3;

/* Compare with the roots obtained using the built-in function. */

roots = polyroot(q);
print roots;
quit;
run;

Answers

(10)
Status NEW Posted 25 Aug 2017 04:08 PM My Price 11.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- T-----------han-----------k Y-----------ou -----------for----------- us-----------ing----------- ou-----------r w-----------ebs-----------ite----------- an-----------d a-----------cqu-----------isi-----------tio-----------n o-----------f m-----------y p-----------ost-----------ed -----------sol-----------uti-----------on.----------- Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m o-----------nli-----------ne -----------or -----------inb-----------ox -----------me -----------a m-----------ess-----------age----------- I -----------wil-----------l

Not Rated(0)