[問題] Shiny上做平行運算(rugarch)

作者: naturalsmen (日日夜夜)   2015-12-19 11:42:31
[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
效能諮詢(我想讓R 跑更快)
[軟體熟悉度]:
入門(寫過其他程式,只是對語法不熟悉)
[問題敘述]:
最近在用rugarch pkg中的ugarchroll做模型回測
是用過去1000天的time window為建模樣本 預測隔天(t+1)的波動度
每天都會重新fit一個新的模型 圖示如下
T daily returns:
|
作者: naturalsmen (日日夜夜)   2015-12-19 11:47:00
補充:灰屏沒有顯示任何警告或錯誤訊息啊範例程式的ugarchroll忘了加cluster進去 晚點修改抱歉
作者: cywhale (cywhale)   2015-12-19 13:18:00
and what you mean "data = -data()$r" ?Igot "Error in -data()$r : invalid argument to unary"
作者: naturalsmen (日日夜夜)   2015-12-19 14:10:00
cywhale: data is the DAX index loaded from 'quandl' and r is the daily log return calculated fromthe DAX data, containing Date, Open Price, ClosePrice, and so on. i put them in the reactive variable 'data', i.e., i make a list to contain thevariables i need in 'data'. In my computer, i can use data()$r to call the log return in the reactive variable 'data'. The negative sign represents the 'negative' log return. i'll check it later,and thanks for replying:)I have just checked the problem and the data()$rworks fine as usual. Maybe u can re-confirm if the quandl function works. Many thanks:)
作者: cywhale (cywhale)   2015-12-19 17:30:00
ya.. the issue is my fault when try andIt' ok to use cluster and get result on shiny-serveron linux, but I got troubles to deploy shinyapps.ioAt least, I have no error runing code on shiny-server(and also no error on local computer). What messagewhen your app crash and press F-12 & select "console"
作者: naturalsmen (日日夜夜)   2015-12-19 21:02:00
Maybe I mixed up the definition of the "shiny server" and the "shiny apps.io", sorry about that. What I mean "shiny server" in the article is the "shiny apps.io". I'll fix it as soon as possible.I can run my app locally but run into trouble onshinyapps.io. Anyways, thanks a lot:)I may give it a shot using your method to see ifI can get any warning message.
作者: cywhale (cywhale)   2015-12-19 23:17:00
I deploy it:https://cywhale.shinyapps.io/test_rugarchbut only no error if I change code to:cluster = makePSOCKcluster(4). If using (10),it crashand got error: server responded with a status of 500
作者: naturalsmen (日日夜夜)   2015-12-20 00:03:00
so maybe it's due to the constraints as a freeuser?

Links booklink

Contact Us: admin [ a t ] ucptt.com