Question: . I should be able to copy and paste the code straight into R and then execute the functions with my own data / parameters
I should be able to copy and
paste the code straight into and then execute the functions with my own dataparameters without
having to track down any bugs myself. A very common mistake that students make is that they make
use of global variables without realizing it and when I copypaste the code into my which doesn't
have these global variables present, it won't work. So a make sure you aren't utilizing global variables,
and b when you think you have everything written and finalized, completely close then start again
this will completely wipe out any variablesdata you've been working with and copypaste your code
and attempt to use it
Write a function called "myrweibull" to generate realizations from the Weibull distribution using
the probability integral transform method. The Weibull cdf is given by:
;
This is the parameterization I want you to use. Also note that the is if
The function's name must be "myrweibull".
It must take the following arguments named as such:
The sample size; ie the number of realizations to generate.
Include error checking to be sure that n is a numeric scalar and greater than or
equal to
If it is not an integer, then coerce into the nearest integer less than the value
given.
No default value.
shape This is the value of It is named "shape" because is a shape parameter.
Include error checking to be sure that shape is a numeric scalar and greater than
No default value.
scale This is the value of It is named scale because is a scale parameter.
Include error checking to be sure that scale is a numeric scalar and greater than
The default value is
It must return the vector of realizations from the desired Weibull distribution.
Additional details:
You may use the default R function "runif" to generate realizations from the
distribution, but do not use "rweibull", "qweibull", or any other builtin Weibullrelated
functions.
Do not attempt to modify or set Rs seed value for random number generation
Please follow all instructions carefully and then attempt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
