Matlab : best approach for estimation





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I would like to estimate parameters :



I have a PSF (Point Spread Function) "y=f(x)" depending of 6 parameters



I have to estimate all the 6 parameters (a,b,r0,c0,alpha,beta) given only "y" output data.



What is the best approach from a statistical point of view ? Can I find the estimations with Matlab fminsearch function ?



Thanks










share|improve this question

























  • For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

    – Adriaan
    Nov 16 '18 at 13:13













  • -@Adriaan thanks, I just put your suggestion

    – youpilat13
    Nov 16 '18 at 13:29











  • See the edit to my answer

    – rinkert
    Nov 16 '18 at 14:55











  • -@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

    – youpilat13
    Nov 16 '18 at 17:14




















1















I would like to estimate parameters :



I have a PSF (Point Spread Function) "y=f(x)" depending of 6 parameters



I have to estimate all the 6 parameters (a,b,r0,c0,alpha,beta) given only "y" output data.



What is the best approach from a statistical point of view ? Can I find the estimations with Matlab fminsearch function ?



Thanks










share|improve this question

























  • For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

    – Adriaan
    Nov 16 '18 at 13:13













  • -@Adriaan thanks, I just put your suggestion

    – youpilat13
    Nov 16 '18 at 13:29











  • See the edit to my answer

    – rinkert
    Nov 16 '18 at 14:55











  • -@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

    – youpilat13
    Nov 16 '18 at 17:14
















1












1








1








I would like to estimate parameters :



I have a PSF (Point Spread Function) "y=f(x)" depending of 6 parameters



I have to estimate all the 6 parameters (a,b,r0,c0,alpha,beta) given only "y" output data.



What is the best approach from a statistical point of view ? Can I find the estimations with Matlab fminsearch function ?



Thanks










share|improve this question
















I would like to estimate parameters :



I have a PSF (Point Spread Function) "y=f(x)" depending of 6 parameters



I have to estimate all the 6 parameters (a,b,r0,c0,alpha,beta) given only "y" output data.



What is the best approach from a statistical point of view ? Can I find the estimations with Matlab fminsearch function ?



Thanks







matlab






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 '18 at 15:28







youpilat13

















asked Nov 16 '18 at 13:08









youpilat13youpilat13

5221442




5221442













  • For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

    – Adriaan
    Nov 16 '18 at 13:13













  • -@Adriaan thanks, I just put your suggestion

    – youpilat13
    Nov 16 '18 at 13:29











  • See the edit to my answer

    – rinkert
    Nov 16 '18 at 14:55











  • -@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

    – youpilat13
    Nov 16 '18 at 17:14





















  • For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

    – Adriaan
    Nov 16 '18 at 13:13













  • -@Adriaan thanks, I just put your suggestion

    – youpilat13
    Nov 16 '18 at 13:29











  • See the edit to my answer

    – rinkert
    Nov 16 '18 at 14:55











  • -@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

    – youpilat13
    Nov 16 '18 at 17:14



















For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

– Adriaan
Nov 16 '18 at 13:13







For the while vs for loop: I like to use a hybrid: kmax = 1e6; while Jmin>epsilon && k<kmax; and then increment k each iteration. This way it will stop when the result is good enough, and if it doesn't reach 'good enough' within the specified number of iterations, it'll stop anyway.

– Adriaan
Nov 16 '18 at 13:13















-@Adriaan thanks, I just put your suggestion

– youpilat13
Nov 16 '18 at 13:29





-@Adriaan thanks, I just put your suggestion

– youpilat13
Nov 16 '18 at 13:29













See the edit to my answer

– rinkert
Nov 16 '18 at 14:55





See the edit to my answer

– rinkert
Nov 16 '18 at 14:55













-@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

– youpilat13
Nov 16 '18 at 17:14







-@rinkert the results with fminsearch, fmincon and ga don't give significant results compared to the parameters fixed before the estimation.There should be an error but I can't find it. Could you take a look please at my source located in the archive on : 31.207.34.24/Archive_Estimation_SO.tar. You will find the cost function in Crit_J.mand the main source is tp_estimation_dev.m . Right now, I can't explain this bad estimation of the six parameters that I want to get. Regards

– youpilat13
Nov 16 '18 at 17:14














1 Answer
1






active

oldest

votes


















1














Right now you are just randomly changing your parameters. If you change to an optimization procedure like implemented in fminsearch, this algorithm will find the minimum for you.



% initial parameters
a = 10;
b = 3;
r0 = 0;
c0 = 0;
alpha = 1;
beta = 1;
% Array of parameters
p0 = [a,b,r0,c0,alpha,beta]';


% Minimization of cost function for p
[pars, Jmin] = fminsearch(@(x)Crit_J(x,D), p0);


You have to change your Crit_J function to only output the 'cost' to minimize for this to work. You can then later obtain your model by running the original function.





Update:



Perhaps you are finding a local minimum, you can try fminunc instead of fminsearch, or switch to a generic algorithm, but that might be overkill for this problem.






share|improve this answer


























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338554%2fmatlab-best-approach-for-estimation%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Right now you are just randomly changing your parameters. If you change to an optimization procedure like implemented in fminsearch, this algorithm will find the minimum for you.



    % initial parameters
    a = 10;
    b = 3;
    r0 = 0;
    c0 = 0;
    alpha = 1;
    beta = 1;
    % Array of parameters
    p0 = [a,b,r0,c0,alpha,beta]';


    % Minimization of cost function for p
    [pars, Jmin] = fminsearch(@(x)Crit_J(x,D), p0);


    You have to change your Crit_J function to only output the 'cost' to minimize for this to work. You can then later obtain your model by running the original function.





    Update:



    Perhaps you are finding a local minimum, you can try fminunc instead of fminsearch, or switch to a generic algorithm, but that might be overkill for this problem.






    share|improve this answer






























      1














      Right now you are just randomly changing your parameters. If you change to an optimization procedure like implemented in fminsearch, this algorithm will find the minimum for you.



      % initial parameters
      a = 10;
      b = 3;
      r0 = 0;
      c0 = 0;
      alpha = 1;
      beta = 1;
      % Array of parameters
      p0 = [a,b,r0,c0,alpha,beta]';


      % Minimization of cost function for p
      [pars, Jmin] = fminsearch(@(x)Crit_J(x,D), p0);


      You have to change your Crit_J function to only output the 'cost' to minimize for this to work. You can then later obtain your model by running the original function.





      Update:



      Perhaps you are finding a local minimum, you can try fminunc instead of fminsearch, or switch to a generic algorithm, but that might be overkill for this problem.






      share|improve this answer




























        1












        1








        1







        Right now you are just randomly changing your parameters. If you change to an optimization procedure like implemented in fminsearch, this algorithm will find the minimum for you.



        % initial parameters
        a = 10;
        b = 3;
        r0 = 0;
        c0 = 0;
        alpha = 1;
        beta = 1;
        % Array of parameters
        p0 = [a,b,r0,c0,alpha,beta]';


        % Minimization of cost function for p
        [pars, Jmin] = fminsearch(@(x)Crit_J(x,D), p0);


        You have to change your Crit_J function to only output the 'cost' to minimize for this to work. You can then later obtain your model by running the original function.





        Update:



        Perhaps you are finding a local minimum, you can try fminunc instead of fminsearch, or switch to a generic algorithm, but that might be overkill for this problem.






        share|improve this answer















        Right now you are just randomly changing your parameters. If you change to an optimization procedure like implemented in fminsearch, this algorithm will find the minimum for you.



        % initial parameters
        a = 10;
        b = 3;
        r0 = 0;
        c0 = 0;
        alpha = 1;
        beta = 1;
        % Array of parameters
        p0 = [a,b,r0,c0,alpha,beta]';


        % Minimization of cost function for p
        [pars, Jmin] = fminsearch(@(x)Crit_J(x,D), p0);


        You have to change your Crit_J function to only output the 'cost' to minimize for this to work. You can then later obtain your model by running the original function.





        Update:



        Perhaps you are finding a local minimum, you can try fminunc instead of fminsearch, or switch to a generic algorithm, but that might be overkill for this problem.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 16 '18 at 14:54

























        answered Nov 16 '18 at 13:29









        rinkertrinkert

        1,5731618




        1,5731618
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338554%2fmatlab-best-approach-for-estimation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues