<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div apple-content-edited="true" class="">
</div>
<div><blockquote type="cite" class=""><div class="">On Jul 30, 2015, at 15: 39, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 28, 2015 at 5:55 AM, Romain Jolivet <span dir="ltr" class=""><<a href="mailto:jolivetinsar@gmail.com" target="_blank" class="">jolivetinsar@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear PETSc developers and users,<br class="">
<br class="">
I am trying to solve a linear least square problem that requires some regularization. My plan is to use a Tikhonov scheme as a first try.<br class="">
Hence, I would like to minimise the function S(x) defined as:<br class="">
<br class="">
S(x) = ||Ax - b||2 + alpha || Cx ||<br class="">
<br class="">
where A is my operator (rectangular matrix with far more lines than columns), x is the vector of unknown, b is some data vector, alpha is a damping factor and C some operator of my own.<br class="">
Ideally C is a gaussian form of a covariance matrix. But at first, I would like to check what happens with an identity (good), gradient (better) or laplacian (best) operator.<br class="">
There is a mention to a MatShift function in some previous post in the mailing list concerning Tikhonov regularization, but I don’t see how to incorporate that into my python set of tools that I have set up to solve my problem (would there be a useful example somewhere?).<br class=""></blockquote><div class=""><br class=""></div><div class="">It would be nice to have an example for this, but I have not made it there yet. For now, it looks like</div><div class="">what you want is</div><div class=""><br class=""></div><div class=""> A.shift(aC)</div><div class=""><br class=""></div><div class="">where A is the Mat that you are currently using in your linear solve, and aC is alpha*C. Does this make sense?</div></div></div></div></div></blockquote><div><br class=""></div><div>Thanks for the answer. </div><div>I am not sure I get it: C is a square matrix the size of the solution vector. How does it fit in the method .shift (I thought this one needs a petsc scalar for input)?</div><div><br class=""></div><div>R</div><br class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div></div></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I feel like there is some possibilities using the TAO wrappers of petsc4py, but I have no idea how to get this guy to work (how do I create the TAO_objective, TAO_gradient, etc?).<br class="">
<br class="">
To get a better understanding of my problem, my ultimate goal is to minimise the function S(x) defined as<br class="">
<br class="">
S(x) = 1/2. * [(Ax-b)’ inv(D) (Ax-b) + (x-x0)’ inv(M) (x-x0)],<br class="">
<br class="">
where D is some covariance matrix describing noise distribution on b, M is the covariance matrix describing the correlations between the parameters of x and x0 is the starting point.<br class="">
But that seems a bit complex so far and I will stick to the first problem yet.<br class="">
<br class="">
Cheers,<br class="">
Romain<br class="">
<br class="">
<br class="">
<br class="">
—————————————————————————————————————<br class="">
—————————————————————————————————————<br class="">
Romain Jolivet<br class="">
Postdoctoral Fellow<br class="">
<br class="">
University of Cambridge<br class="">
Department of Earth Sciences<br class="">
Bullard Labs<br class="">
Madingley Rise<br class="">
Madingley Road<br class="">
Cambridge CB3 0EZ<br class="">
United Kingdom<br class="">
<br class="">
email: <a href="mailto:rpj29@cam.ac.uk" class="">rpj29@cam.ac.uk</a><br class="">
Phone: <a href="tel:%2B44%201223%20748%20938" value="+441223748938" class="">+44 1223 748 938</a><br class="">
Mobile: <a href="tel:%2B44%207596%20703%20148" value="+447596703148" class="">+44 7596 703 148</a><br class="">
<br class="">
France: <a href="tel:%2B33%206%2052%2091%2076%2039" value="+33652917639" class="">+33 6 52 91 76 39</a><br class="">
US: <a href="tel:%2B1%20%28626%29%20560%206356" value="+16265606356" class="">+1 (626) 560 6356</a><br class="">
—————————————————————————————————————<br class="">
—————————————————————————————————————<br class="">
<br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div>
</div></div>
</div></blockquote></div><br class=""></body></html>