Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in R code please ! if anyone could help with q1 a-d i would really appreciate it ! f(x)={ba10ifax1otberwise Wo want to write a function

in R code please ! if anyone could help with q1 a-d i would really appreciate it ! image text in transcribed
f(x)={ba10ifax1otberwise Wo want to write a function duniforn (x,a,b) that taikon an arbitrary value of x and parameters a and b and retum the appropriate height of the densty function. For various values of x, a, and b. demonstrate that your function returns the correct density value. a. Write your function without regand for at working with vectors of data. Demonstate that it works by caling the function with a three times, once where xy ggplot ( aes (xx2,yyy)++ geon_step() e. Instal the R package microbenchnark. We will use this to dscover the nuerage duration your function takes. nicrobenchmarki:aicrobenchmarki dunifornt segi 4,12, byr, eotif. This will call the input A expression 100 times and repon summary statistics on how long a took for the code to nu, In particulat, look at the median time for evaluation. d. Instead of using a for loop, it might have been easier to use an ifelse() command. Plowrte your function to avoid the for- locp and just use an ifelse () command. Verify that your function works conectly by producing a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago