{"action":"created","issue":{"url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/3","repository_url":"https://api.github.com/repos/daanhb/FrameFuns.jl","labels_url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/3/comments","events_url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/3/events","html_url":"https://github.com/daanhb/FrameFuns.jl/issues/3","id":163465552,"number":3,"title":"Automatic construction of a `framefun` with a reasonably optimal length","user":{"login":"kuanxu","id":3542751,"avatar_url":"https://avatars.githubusercontent.com/u/3542751?v=3","gravatar_id":"","url":"https://api.github.com/users/kuanxu","html_url":"https://github.com/kuanxu","followers_url":"https://api.github.com/users/kuanxu/followers","following_url":"https://api.github.com/users/kuanxu/following{/other_user}","gists_url":"https://api.github.com/users/kuanxu/gists{/gist_id}","starred_url":"https://api.github.com/users/kuanxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuanxu/subscriptions","organizations_url":"https://api.github.com/users/kuanxu/orgs","repos_url":"https://api.github.com/users/kuanxu/repos","events_url":"https://api.github.com/users/kuanxu/events{/privacy}","received_events_url":"https://api.github.com/users/kuanxu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-01T20:05:27Z","updated_at":"2016-07-08T08:55:39Z","closed_at":null,"body":"Is it possible to have an automatic `framefun` constructor which is able to construct a `framefun` with a reasonably optimal length `n` for a given function handle? I mean something similar to the `chebfun` constructor which keeps increasing the length of the approximation until the function is \"fully resolved\". \r\n\r\nI had a vague impression that @daanhb mentioned that the Fourier extension coefficients are not necessarily decaying, which prevents an automatic construction. But I checked with a few examples and found that the Fourier extension coefficients are indeed getting smaller and smaller as the frequency goes higher and higher. Any comments?\r\n\r\nIt'll be nice if we can have such an auto-ctor. But, of course, even if it is possible to have such a thing, I'm _not_ suggesting this should be something default at the user level."},"comment":{"url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/comments/231309328","html_url":"https://github.com/daanhb/FrameFuns.jl/issues/3#issuecomment-231309328","issue_url":"https://api.github.com/repos/daanhb/FrameFuns.jl/issues/3","id":231309328,"user":{"login":"daanhb","id":7403822,"avatar_url":"https://avatars.githubusercontent.com/u/7403822?v=3","gravatar_id":"","url":"https://api.github.com/users/daanhb","html_url":"https://github.com/daanhb","followers_url":"https://api.github.com/users/daanhb/followers","following_url":"https://api.github.com/users/daanhb/following{/other_user}","gists_url":"https://api.github.com/users/daanhb/gists{/gist_id}","starred_url":"https://api.github.com/users/daanhb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daanhb/subscriptions","organizations_url":"https://api.github.com/users/daanhb/orgs","repos_url":"https://api.github.com/users/daanhb/repos","events_url":"https://api.github.com/users/daanhb/events{/privacy}","received_events_url":"https://api.github.com/users/daanhb/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T08:55:39Z","updated_at":"2016-07-08T08:55:39Z","body":"Sorry for my slow reply @kuanxu. This is a very good point, and as you mention the adaptive construction of a frame approximation is not straightforward. It is a topic of its own that we did not address yet. Feel free to experiment and suggest possible solutions :-)\r\n\r\nFor completeness, let me outline some considerations:\r\n- The underlying problem is that, as you know, after you have computed an approximation with N coefficients there is no clear indication how many coefficients M <= N would have been sufficient. It is not the case that the coefficients decay to machine precision and stay there.\r\n- There is indeed usually some decay of the Fourier extension coefficients. However, that decay is not related to the smoothness of the function as is usually the case in approximation schemes, and it is fairly unpredictable. There is no guarantee. Truncating the expansion based on this decay would be far from optimal.\r\n- We can compute a smoothed Fourier extension in O(N log N) operations with an adaptation of the fast algorithm. This has not yet appeared in literature, but it is included in the implementation. With this algorithm, the coefficients do decay at a certain rate and they can simply be truncated. However, with our algorithm you have to guess a priori the smoothness of the function, since you essentially enforce decay at a certain rate. You can truncate, but it would still not be optimal unless you adaptively find the maximal decay rate.\r\n- Since we solve a least squares approximation problem Ax=B with rectangular matrix A, you can assess the approximation error by calculating the residual Ax-B. The maximum of the residual is a reliable estimate of the maximum pointwise error of the approximation. Based on this, one could imagine a bisection iteration to find the optimal number of degrees of freedom to reach a certain precision. Constructing larger and larger approximations until the function is resolved, as you suggest, should be possible. Being ambitious, though, you would still want to optimally truncate the final approximation.\r\n- Our fast algorithm currently employs a lot of matrix-vector products with random vectors, and a full SVD of a small but dense matrix. Ideally, in an adaptive algorithm, the results of these computations are reused when the number of degrees of freedom changes. It is not clear how to do this.\r\n"}}
{"actor":{"display_login":"daanhb"}}