3
我試圖修改直方圖的形狀導致從「初始」大樣品獲得使用Initial = rbeta(1e5, 2, 3)
。具體而言,我想初始大樣本的修改版本以具有2附加的較小(高度)「駝峯」(即,除了在初始大樣品中存在的彼此2較小高度的峯) 。
編碼問題:
我想知道如何操縱sample()
(也許使用其prob
參數)中的R基使得以這樣的方式該命令的樣品,這兩個附加隆起約爲「 .5"和。」 6"在X軸?
這是我的當前R代碼:
Initial = rbeta(1e5, 2, 3) ## My initial Large Sample
hist (Initial) ## As seen, here there is only one "hump" say near
# less than ".4" on the X-Axis
Modified.Initial = sample(Initial, 1e4) ## This is meant to be the modified version of the
# the Initial with two additional "humps"
hist(Modified.Initial) ## Here, I need to see two additional "humps" near
# ".5" and ".6" on the X-Axis