{"action":"created","issue":{"url":"https://api.github.com/repos/dill/Distance2/issues/67","labels_url":"https://api.github.com/repos/dill/Distance2/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/dill/Distance2/issues/67/comments","events_url":"https://api.github.com/repos/dill/Distance2/issues/67/events","html_url":"https://github.com/dill/Distance2/issues/67","id":116740333,"number":67,"title":"Create function that calculates several detection functions","user":{"login":"fsdias","id":5689181,"avatar_url":"https://avatars.githubusercontent.com/u/5689181?v=3","gravatar_id":"","url":"https://api.github.com/users/fsdias","html_url":"https://github.com/fsdias","followers_url":"https://api.github.com/users/fsdias/followers","following_url":"https://api.github.com/users/fsdias/following{/other_user}","gists_url":"https://api.github.com/users/fsdias/gists{/gist_id}","starred_url":"https://api.github.com/users/fsdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsdias/subscriptions","organizations_url":"https://api.github.com/users/fsdias/orgs","repos_url":"https://api.github.com/users/fsdias/repos","events_url":"https://api.github.com/users/fsdias/events{/privacy}","received_events_url":"https://api.github.com/users/fsdias/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-13T10:17:17Z","updated_at":"2015-11-13T10:21:57Z","closed_at":null,"body":"Users usually have to calculate several candidate detection functions, which can be tedious, particularly when there are two or more covariates. See the example below:\r\n\r\n#CDS\r\ndf1 <- ds(data_sni, truncation=70, model=df(model=~unif+cos(1,2)))\r\ndf2 <- ds(data_sni, truncation=70, model=df(model=~hn+cos(2)))\r\ndf3 <- ds(data_sni, truncation=70, model=df(model=~hn+hermite(2)))\r\ndf4 <- ds(data_sni, truncation=70, model=df(model=~hr+poly(2)))\r\n\r\n#MCDS\r\ndf5 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~size),control=list(parscale=c(1,0.01,1)))\r\ndf6 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~stratum))\r\ndf7 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~decay))\r\ndf8 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~size+stratum))\r\ndf9 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~decay+stratum))\r\ndf10 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~size+decay))\r\ndf11 <- ds(data_sni, truncation=70, model=df(model=~hr,scale=~size+decay+stratum),control=list(parscale=c(1,0.01,1)))\r\n\r\n\r\ndf12 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~size))\r\ndf13 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~stratum))\r\ndf14 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~decay))\r\ndf15 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~size+stratum))\r\ndf16 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~decay+stratum))\r\ndf17 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~size+decay))\r\ndf18 <- ds(data_sni, truncation=70, model=df(model=~hn,scale=~size+decay+stratum))\r\n\r\nI would like to suggest creating a a function that calculates several (sensible) detection functions at the same time. \r\n\r\nFor instance, for CDS it would be good to have something that calculates all sensible combinations of key functions and adjustment terms (as presented in the JoAE paper). \r\n\r\nEg. batch_cds(key(hn,hr), adj=c(\"cos(2,3)\",\"herm\"),data=data)\r\n\r\nFor MCDS something that runs all key functions and possible combinations of covariates)\r\n\r\nbatch_mcds(key(hn,hr), covariates(cov1*cov2),data=data)"},"comment":{"url":"https://api.github.com/repos/dill/Distance2/issues/comments/156388855","html_url":"https://github.com/dill/Distance2/issues/67#issuecomment-156388855","issue_url":"https://api.github.com/repos/dill/Distance2/issues/67","id":156388855,"user":{"login":"erex","id":330744,"avatar_url":"https://avatars.githubusercontent.com/u/330744?v=3","gravatar_id":"","url":"https://api.github.com/users/erex","html_url":"https://github.com/erex","followers_url":"https://api.github.com/users/erex/followers","following_url":"https://api.github.com/users/erex/following{/other_user}","gists_url":"https://api.github.com/users/erex/gists{/gist_id}","starred_url":"https://api.github.com/users/erex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erex/subscriptions","organizations_url":"https://api.github.com/users/erex/orgs","repos_url":"https://api.github.com/users/erex/repos","events_url":"https://api.github.com/users/erex/events{/privacy}","received_events_url":"https://api.github.com/users/erex/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T10:21:57Z","updated_at":"2015-11-13T10:21:57Z","body":"I understand the appeal of this 'industrial' approach.  The difficulty being a way to have Distance determine what constitutes 'sensible' detection functions.\r\n\r\nParticularly in the MCDS context, there can be a host of convergence problems introduced because various combination of covariate factor levels (assuming factor covariates) are not represented in the data.\r\n\r\nRecognise the challenges of \"all possible combinations\" in modelling of anything whether it be detection functions or survival rates."}}