Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- ##2a-e
- attach(Weibull)
- View(Weibull)
- HW2A<- Weibull$Values
- HW2A
- length(HW2A)
- ### I assume i will use these to answer part 2c
- hist(HW2A)
- mean(HW2A)
- var(HW2A)
- sd(HW2A)
- ### this is the distro he wants us to use. the thing i dont know is the shape and scale
- ## i just used the defults which are 1. I am not sure because it left skewed if the shape number is different
- ## this is my first time with a weibull. The number I get from the weibull what does that mean to me?
- ## I am assuming i need the value for the MLE but I am not sure where.
- dweibull(100,shape = 1, scale = 1)
- ###This is where i get stuck because the first homework assignment the MLE did not work for me
- ### and i even had my professor help me and we could not get it to work.
- ## I am stuck here because I am assuming I am using the mean and sd i collected from above.
- ### I am just not sure where the dweibull value goes. I can always email my professor about it.
- ## the other thing I do not know is for my optim how do I know what the continous values need to be?
- NormalMLE <- function(params, data){
- mLL <- -1 * sum(log(dnorm(data, mean = params[5], sd = params[3])))
- mLL
- }
- set.seed(5434)
- mdl2 <- rnorm(100, mean=5, sd=3)
- optim(par = c(3,10), fn = NormalMLE, data = s1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement