First Course in Statistical Programming With R (9781316715529) by Braun W. John; Murdoch Duncan J. & Duncan J. Murdoch

First Course in Statistical Programming With R (9781316715529) by Braun W. John; Murdoch Duncan J. & Duncan J. Murdoch

Author:Braun, W. John; Murdoch, Duncan J. & Duncan J. Murdoch
Language: eng
Format: epub
Publisher: Cambridge Univ Pr
Published: 2016-06-16T16:00:00+00:00


Exercises

1 Compute 10!, 50!, 100!, and 1000!.

2

(a)Using fix() and factorial(), create a function which computes the binomial coefficient

(b)Compute , , and .

(c)The sum() function can be used to sum up all elements of its argument, while the log() and exp() functions take the natural logarithm and exponential of all elements in their argument. Use these functions to create an improved function to compute binomial coefficients.

(d)Compute , , and using the improved version.

3 Refer to Exercise 2 of Section 4.2.1 in which you created a function called compound.interest(). Often, the interest rate is quoted as a nominal annual rate, compounded monthly. To obtain the monthly rate, the nominal annual rate is simply divided by 12. More generally, if there are m interest conversion periods in a year, the nominal annual rate is divided by m to obtain the effective interest rate for the appropriate conversion period. (e.g. If the compounding is daily, the nominal annual rate is divided by 365.) Fix compound.interest() so that a nominal annual interest rate j and m, the number of conversion periods per year, are part of the argument. The effective rate is assigned in the body of the function. (You may delete from the argument list.)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.