Relative Content

Tag Archive for roptimization

R optim() Not Converging to Target R-squared Value

I’m trying to wrap my head around the optim() function in R. Therefore I tried to optimize two beta parameters (beta1 and beta2) in a linear model so that the resulting R-squared value matches a specified target (e.g., 0.1). I’ve written the following code in R:

Optim convergence

I’ve been trying to estimate the parameters of a reliability distribution called Kumaraswamy Inverse Weibull (KumIW), which can be found in the package ‘RelDists’. I tried to use the function optim, but it doesn’t matter the start that I give, the data generated by ‘rKumIW’ or the sample size, the mu parameter always converge to one, although the others parameters converge to the correct values. What can be done? Should I try to use another function from some different package?