How to make unequally spaced grid? I want to make a grid [0,1] with 100 points but I want points to be concentrated at the edges close to 0 and 1. So I want 60-70% of the points to be in the intervals [0, 0.2] and [0.8, 1]. Any ideas on how I can do this?
One quick way to do this is through inverting a distribution c.d.f.. For example, the distribution Beta(alpha,beta) has density concentrated at small and large values when alpha and beta are less than one. Thus, you can first generate equally spaced grid, and then use the inverse function of Beta c.d.f to map the grid to unequally spaced grid. You can change the percentiles you want (60-70%, e.g.) by setting the appropriate alpha and beta.