{"action":"created","issue":{"url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/1","labels_url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/1/comments","events_url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/1/events","html_url":"https://github.com/matthieugomez/SparseFactorModels.jl/issues/1","id":102692584,"number":1,"title":"Error message: ERROR: Initial value and slope must be finite when using method \"ar\"","user":{"login":"chriscandelaria","id":13926741,"avatar_url":"https://avatars.githubusercontent.com/u/13926741?v=3","gravatar_id":"","url":"https://api.github.com/users/chriscandelaria","html_url":"https://github.com/chriscandelaria","followers_url":"https://api.github.com/users/chriscandelaria/followers","following_url":"https://api.github.com/users/chriscandelaria/following{/other_user}","gists_url":"https://api.github.com/users/chriscandelaria/gists{/gist_id}","starred_url":"https://api.github.com/users/chriscandelaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriscandelaria/subscriptions","organizations_url":"https://api.github.com/users/chriscandelaria/orgs","repos_url":"https://api.github.com/users/chriscandelaria/repos","events_url":"https://api.github.com/users/chriscandelaria/events{/privacy}","received_events_url":"https://api.github.com/users/chriscandelaria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T03:11:33Z","updated_at":"2015-08-24T13:10:18Z","closed_at":null,"body":"I received the following error after submitting an IFE model on Julia using the SparseFactorModels package:\r\n`ERROR: Initial value and slope must be finite`\r\n` in hz_linesearch! at /home/candelar/.julia/v0.3/Optim/src/linesearch/hz_linesearch.jl:184`\r\n` in hz_linesearch! at /home/candelar/.julia/v0.3/Optim/src/linesearch/hz_linesearch.jl:176 (repeats 9 times)`\r\n` in update_half! at /home/candelar/.julia/v0.3/SparseFactorModels/src/algorithms/gd.jl:88`\r\n` in update! at /home/candelar/.julia/v0.3/SparseFactorModels/src/algorithms/gd.jl:59`\r\n` in fit! at /home/candelar/.julia/v0.3/SparseFactorModels/src/algorithms/gd.jl:135`\r\n` in fit at /home/candelar/.julia/v0.3/SparseFactorModels/src/fit.jl:123`\r\n` in include at ./boot.jl:245`\r\n` in include_from_node1 at ./loading.jl:128`\r\n`while loading /share/PI/reininge/Users/candelar/SchFinIFE/julia/juliacode1.jl, in expression starting on line 9`\r\n\r\nHere are the commands I submitted to run the IFE model:\r\n\r\n`# Load packages`\r\n`using SparseFactorModels, DataFrames, FixedEffectModels`\r\n`# Import data`\r\n`df = readtable(\"juliaexportTEMP.csv\")`\r\n`# Prepare data for SparseFactorModels`\r\n`df[:pdistid] = pool(df[:distid])`\r\n`df[:pfrplyear] = pool(df[:frplyear])`\r\n`df[:pyear] = pool(df[:year])`\r\n`df[:pstate] = pool(df[:stabb_num])`\r\n`df[:pstatefrpl] = pool(df[:stabbfrpl])`\r\n`# Factor structure`\r\n`fmtestgradrate01_tc11 = SparseFactorModel(:pstate, :pyear, 1)`\r\n\r\n`# Estimation Model: The fit function (below) appears on line 9 of my program file. This is the line to which the error above refers.`\r\n`fmtestgradrate01_tc11RUN = fit(fmtestgradrate01_tc11, gradrate01_tc ~  TECfrpl1yr1 + TECfrpl1yr2 + TECfrpl1yr3 + TECfrpl1yr4 + TECfrpl1yr5 + TECfrpl1yr6 + TECfrpl1yr7 + TECfrpl1yr8 + TECfrpl1yr9 + TECfrpl1yr10 + TECfrpl1yr11 + TECfrpl1yr12 + TECfrpl1yr13 + TECfrpl1yr14 + TECfrpl1yr15 + TECfrpl1yr16 + TECfrpl1yr17 + TECfrpl1yr18 + TECfrpl1yr19on + TECfrpl2yr1 + TECfrpl2yr2 + TECfrpl2yr3 + TECfrpl2yr4 + TECfrpl2yr5 + TECfrpl2yr6 + TECfrpl2yr7 + TECfrpl2yr8 + TECfrpl2yr9 + TECfrpl2yr10 + TECfrpl2yr11 + TECfrpl2yr12 + TECfrpl2yr13 + TECfrpl2yr14 + TECfrpl2yr15 + TECfrpl2yr16 + TECfrpl2yr17 + TECfrpl2yr18 + TECfrpl2yr19on + TECfrpl3yr1 + TECfrpl3yr2 + TECfrpl3yr3 + TECfrpl3yr4 + TECfrpl3yr5 + TECfrpl3yr6 + TECfrpl3yr7 + TECfrpl3yr8 + TECfrpl3yr9 + TECfrpl3yr10 + TECfrpl3yr11 + TECfrpl3yr12 + TECfrpl3yr13 + TECfrpl3yr14 + TECfrpl3yr15 + TECfrpl3yr16 + TECfrpl3yr17 + TECfrpl3yr18 + TECfrpl3yr19on + TECfrpl4yr1 + TECfrpl4yr2 + TECfrpl4yr3 + TECfrpl4yr4 + TECfrpl4yr5 + TECfrpl4yr6 + TECfrpl4yr7 + TECfrpl4yr8 + TECfrpl4yr9 + TECfrpl4yr10 + TECfrpl4yr11 + TECfrpl4yr12 + TECfrpl4yr13 + TECfrpl4yr14 + TECfrpl4yr15 + TECfrpl4yr16 + TECfrpl4yr17 + TECfrpl4yr18 + TECfrpl4yr19on   |> pdistid + pfrplyear , df, method=:ar, VcovCluster(:pstate), tol=1e-7, maxiter=80000)`\r\n\r\nOn August 18, I was able to run the model, but when I recently installed the package updates on my server computer, I started getting this error. For some reason, the `gd` algorithm is being called, even though I specify the use of method `ar`. Perhaps I am missing something? Should `gd` be called? Any help would be greatly appreciated. I am happy to provide any additional information. Thanks!\r\n\r\nNote: I am using Julia Language 0.3.1 on a Linux environment. I will also try this on MacOSX. \r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/comments/134196622","html_url":"https://github.com/matthieugomez/SparseFactorModels.jl/issues/1#issuecomment-134196622","issue_url":"https://api.github.com/repos/matthieugomez/SparseFactorModels.jl/issues/1","id":134196622,"user":{"login":"matthieugomez","id":6223837,"avatar_url":"https://avatars.githubusercontent.com/u/6223837?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieugomez","html_url":"https://github.com/matthieugomez","followers_url":"https://api.github.com/users/matthieugomez/followers","following_url":"https://api.github.com/users/matthieugomez/following{/other_user}","gists_url":"https://api.github.com/users/matthieugomez/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieugomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieugomez/subscriptions","organizations_url":"https://api.github.com/users/matthieugomez/orgs","repos_url":"https://api.github.com/users/matthieugomez/repos","events_url":"https://api.github.com/users/matthieugomez/events{/privacy}","received_events_url":"https://api.github.com/users/matthieugomez/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T13:10:18Z","updated_at":"2015-08-24T13:10:18Z","body":"I'm not sure why this happens. It does not happen on the dataset I'm testing the package with. Can you reproduce it on some publicly available dataset with a simple model?\r\n\r\nFor now, I've just removed the initialization of the model through `:gd` so that should work, but I'm curious to understand why this happens.\r\n\r\nTo update the package, do `Pkg.checkout(\"SparseFactorModels.jl\")\r\n\r\nPS:  instead of adding all dummies for TECfrp1yr, you could just do\r\n```julia\r\ndf[:pTECfrpl1yr] = pool(TECfrpl1yr)\r\ndf[:pTECfrpl2yr] = pool(TECfrpl2yr)\r\ndf[:pTECfrpl3yr] = pool(TECfrpl3yr)\r\ndf[:pTECfrpl4yr] = pool(TECfrpl4yr)\r\n fit(fmtestgradrate01_tc11, gradrate01_tc ~ pTECfrpl1yr + pTECfrpl2yr + pTECfrpl3yr + pTECfrpl4yr)\r\n```\r\nif `TECfrpl1yr` is a categorical variable with the lagged year.\r\nIn other words, one variable is `pooled`, it is automatically understood as a categorical variable, and you'll get the same regression than when you add all the dummies"}}