Saturday, August 31, 2019

Text book or distilled guide to market making?



Are there any practical articles, blogs or books that describe common practices in market making and how to calculate and use common measures?


The majority of the information I found are research papers. For example, the links in the following question: academic papers about market making


Are there any articles on how the research papers above are used in practice?




adobe illustrator - How to overlap a continuous line on itself?


Yesterday I tried to create the following shape:
enter image description here


Following the path from the top it goes round, crosses over itself (bottom left), goes around again and passes under itself before going back up again. The paper sketch was easy to make.



However, in Illustrator I expected to create this with a single path and an outline of that path. With a single path I ran into the problem that it could never pass over itself. The boundaries would then disappear: enter image description here


Then I went ahead and made it in a convoluted way with multiple elements, which made editing very slow and rigid:enter image description here


Now I am wondering how I can recreate this image (or any self-crossing path) using a more flexible method which allows for easy editing afterwards.



Answer



It is possible to do this without cutting the curve. What you do is you use the appearance panel to overlay 2 strokes on top of each other. Then over this layer copy the same strokes, but this time with a dash that is set up so that the stroke only covers a part of the curve.


enter image description here


Image 1: A path that overlaps itself.


This works irrespectivelly wether the curve is open or closed. There is also a an alernative approach for this problem that has been answered before in the question:



website design - Project dependency visualization and navigation


I have to visualize software project dependencies and provide a way to navigate through the dependencies. I want to combine showing the dependencies of the currently selected project as well as projects that depend on it. So there are basically two directed trees connected to a graph to show.


After some searching on the web, I developed my idea of a solution, which I post as an answer. I am looking forward for you alternative solutions and / or comments.




Friday, August 30, 2019

critique - Does this logo match the brief?


I am a software developer, setting up a new company called mascot to sell my services. The logo is based on the Maneki-neko Japanese beckoning cat. The logo should be friendly, fun and professional looking. I have gone through lots of iterations to arrive at this logo which has been completely re-worked, based on feedback from friends, and also from this question.


There is a minimal black version for dark background and a full version. Also, on the website, the cat will be waving slowly: https://mascot-elbxrwafrs.now.sh


enter image description here


The cat is holding a medieval Japanese coin (as is traditional for beckoning cats) and in this case has the word Kanban which refers to an agile software development practice originating from Japan.


Does the logo look friendly, fun and professional looking?


Any feedback greatly appreciated, thanks.




Answer



I just see a black cat.



To create a pictogram, avoid designing from the remote memory, on the contrary, take as a starting point a real reference and elaborate the abstraction. Especially when we are not very good at drawing.



I think you have taken as a reference to create the pictogram geometric shapes arranged in a way that simulate being the Maneki-neko when the process should be the opposite: from the Maneki-neko to a geometric abstraction (depending on what I suppose you are looking for.


As can be seen, all Maneki-neko have important formal common points that your pictogram does not keep. When the differences are so many and so marked, the resemblance between the real object and the pictogram is increasingly remote:


enter image description here



  1. Large rounded ears / Small pointed ears


  2. Small head compared to the body / Head the same size (or bigger) than the body

  3. No neck / Exaggerated neck

  4. Arm above the eye line / Arm below the line of the mouth

  5. Base body seated and stable proportionally greater than the rest of shapes - Small and unstable body

  6. Base rounded inwards - Base pointed outwards

  7. Different Proportions


My recommendation, as written before, is making the reverse process, starting with the real object and create the geometric abstraction:


Step1


Step2



Taking this as a starting point:




  • Abstract, change or geometrize the shapes




  • Study which of the points described in the differences are not the most relevant to keep within the abstraction of the new pictogram. As an example, I personally believe that maintaining proportions is relevant to relate the real object with its abstraction.




design - Spacing between UI components


I tried looking up previous questions but came up empty on this one. I am sure that there are various standards and guidelines out there for this (Android, Apple or Windows), but it also seems like they break their own standards regularly.


Is there are minimum agreed standard for spacing between UI components for touch devices that can be used as a baseline to make adjustments? I assume this would be based on similar principles as those proposed for button sizes.


To clarify the question a little bit further, is the confusion between the spacing also due to the specification of padding space around the UI in addition to gaps added? I haven't seen these differences specified clearly anywhere, but I assume that the padding space should be uniform while the gap can vary depending on how you group the UI elements together on the interface.




designers - Is math needed for graphic design?


I want to be a graphic designer when I am older as I am good at it now.


I am 14 and great with using Photoshop and other software, but I'm wondering if I need to be good at math to become a good graphic designer, as I am not that good at math, nor too bad.


Is math needed?




user research - Where is the best way to approach hallway usability testing?


I found UserTesting.com but it costs $40 per person which is super expensive. I want to test if I am communicating the correct message to users on our site. Where is a good place to do some hallway testing? Or does it have to be in-person?



Answer





  • it's just a message to test, e.g. a tagline on your site that explains what the site/product is about, not a bunch of features at once

  • $40 is too much for that (I agree) but I guess $3 would be ok

  • personal interview preferred over anonymous test (at least this is my preference - so much richer feedback)




Here is how it works:



  • Go to a coffee house or similar place where people spend some time

  • Find people that could be users of your site

  • Approach them right after they bought a coffee and ask them:
    "You just bought a coffee. Can I buy you a muffin and get two minutes of your time for a quick feedback on my website?"

  • Ask your questions and make them talk as much as possible without influencing them

  • Get inspired by the answers and find out if your message works


The last question, especially if the message/site didn't work well, is to explain the intention and ask them what they would have understood better. But only do this as the last thing, don't get into a debate take the comment with a grain of salt.





*I call this Starbucks testing because it works especially well in coffee houses where people are relaxed and spending some leisure time. Often they're open to talk. It might be different in other countries or cultures. I think key success factors are that they get a little reward for their time investment and to make them understand that you won't be trying to sell something.


If you want to learn more about user testing I'd suggest Rocket surgery made easy by Steve Krug - an enjoyable and entertaining read.


Thursday, August 29, 2019

equities - Is the stock price process a martingale or a Markov process?


Some people claim that the data-generating process for stocks is a "martingale" and that is has the "Markov property".


Are they unrelated? Is it that the Markov property implies some sort of martingale property, or is it the other way around?


How do you statistically test for such properties? How far from reality is it to assume such properties?



Answer



From what I remember, there is no real relation between Markov and Martingale, and my intuition was confirmed by this post.


Basically, it says that you can say neither of the following:


If A is Markov, then A is a martingale.



If A is a martingale, then A is Markov.


further down the post, you can find two counter examples:


$dX_t = a dt + \sigma dW_t$ is Markov but not a martingale


and


$dX_t = (\int_0^t X_s ds) dW_t$ is a Martingale but is not Markov.


As for the assumption of these properties being true, I think it really depends on how you see stock markets. My personal opinion being that no, the assumption is not very realistic.


buttons - Should a delete action's "undo" be underneath the "delete"?


Take for example this button:


                 _________
/ \

| Trash |
\_________/

Which when clicked, becomes this:


   _________     _________
/ \ / \
| Restore | | Destroy |
\_________/ \_________/

Which means that when clicking on the delete button, your mouse is already on the confirm button, which allows a quick double click to delete. This is good for deleting many items quickly. But a naive user might accidentally double click on the button, resulting in a permanent delete rather than a prompt to confirm.



The action I'm implementing is a Trash / Restore / Destroy pattern, where you have the option to either restore or destory an item that has been trashed.


What's better - protecting the user from an accidental destroy or allow faster deletes by having the confirm to destory action "underneath" the trash button?



Answer



This is one of the most common design patterns.


A lot of research has gone into delete confirmations, so it's impossible to cover all the variants in one answer: the best solution for you will depend on the degree of confirmation, warning, speed, and likely user intent.


That said, here's one approach which represents the 'state of the art' in delete confirmations:



  • For most applications, the majority of users who click on Delete actually want to delete an item. For example, let's say >85% of delete clicks for your app are well-intended and <15% are unintentional for various reasons (accidental click, user changed mind, user didn't understand the button, etc.)

  • Therefore, for >85% of cases, an extra confirmation or click is an unnecessary impediment for users.

  • Therefore, the best solution that works for the vast majority of cases is just a Delete button with no added confirmation step.


  • Now, we still have to deal with the <15% of users who delete unintentionally. Since this is a minority case, an Undo button that allows users to fully unwind the deletion works best.

  • Here, the Undo button should not be placed near the Delete button, to avoid accidental undos. It should be clearly placed somewhere close by so that the unintentional user can rewind the transaction.

  • The Undo button should be visible for long enough for the user to reasonable reconsider an unintentional delete, but not so long that it sticks around intrusively after the user has gone on to do other tasks.


This is just one of many approaches, but I like it because it incorporates a proper prioritization of usage, and creates cognitive flow and friction at the right time. Your needs may be different so you may require a different approach with more/less confirmation and more/less eager deletion.


The 'no-confirmation' approach is used in apps like Gmail, which provide a single button for delete, and then use a visible snackbar or toast that appears for a period of time after the deletion to allow the user to undo the delete.


Since back-end implementation is not part of the UX design, I'll add a comment below with a note on that.


planning - How does one deal with world builder's syndrome?


I am a planner in the extreme. I tend to drift toward fantasy oriented novels when writing; it's just what comes out. This means that I do quite a bit of planning for the world that the story will be set in. I know that's not a bad thing, but I have noticed that I have a tendency to get bogged down in specific events - especially historical events. I'll find myself describing entire battles or diplomatic missions or even important local events as though they were the story itself - and almost none of that is ever going to even show up in the story!


I really enjoy that preparation, but eventually my notes become so unwieldy, it's hard to actually sit down and write the story while keeping it all straight. Not to mention that it's kind of wasting time when I could be writing.


My questions are: Is there a helpful way to gauge when "enough is enough"? How do I put an end to this world builder's syndrome I've got? Or at least keep it in check? Does anyone have any advice on how know when it might be necessary to do some more fleshed-out preparation and when it's just wasting time (and accumulating too many notes)?



By the way, my average preparation results in something on the order of 150,000+ words (the most I've ever written is 300,000). In other words, I consistently find myself writing a novel before I even write my novel. And I know it's hindering more than helping me. I just don't even realize I'm doing it most of the time until it's too late.


[And, of course, less than a month after asking this question, there is a wonderful post which answers most all of my questions on Patricia Wrede's blog: http://pcwrede.com/blog/obsessive-overbuilding/ - it is well worth reading if you're interested in this topic.]



Answer



Having more details than you need, is not a bad thing per se. Many writers do that, and it often leads to an authentic world, even if the reader isn't aware of all these details. It is especially helpful, if you plan a long series of books for the same world.


But you are describing procrastination. You do not want to start, so you do other things, which seem more important. That's how I find the time to clean my bathroom. It's a useful thing to do, but the truth is, you are deferring your real work: writing.


I have two suggestions for your situation:




  1. Short term approach: Despotic rule: Start writing your novels without any rules. Play the capricious Almighty of your fantasy world and make rules up as you go. If you have become obsessed with one thing, try the complete opposite approach. Then hopefully you find the middle course yourself.





  2. Long term approach: There are a lot of books out there dealing with procrastination. Pick one (and only one; do not read one after the other; that's procrastination again). Look at the advice and take out of the book what you need. There will be no single book, which is exactly suitable for your situation. They are only useful to give you some ideas, how to get back to work. (If you have no idea, which book you should take: "Getting Things done" is one of the most popular - meritedly or not).




Black--Scholes hedging argument


I'm trying to understand the standard hedging argument to derive the Black--Scholes PDE. There's one aspect of the derivation which I can't get passed and I'd be very grateful for some clarification here.


We make the standard assumptions: underlying follows a geometric BM, i.e. $\text{d} S_t = \mu S_t \text{d}t + \sigma S_t \text{d}W_t$ and we let $V(S_t,t)$ be an option written on this security so that by Ito's Lemma, we have:


$\text{d} V_t = \left(\frac{\partial V}{\partial t} + \mu S_t \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2_t \frac{\partial^2 V}{\partial S^2}\right) \text{d}t + \left(\sigma S_t \frac{\partial V}{\partial S}\right) \text{d}W_t$


All good so far. We then set-up a portfolio consisting of a single option and some amount $\Delta(S_t,t)$ of the underlying whose value is given by $\Pi_t = V_t + \Delta(S_t,t) S_t$. It is then assumed that this portfolio be self-financing, i.e. that there are no additional inflows or outflows of cash, formalised as $\text{d} \Pi_t = \text{d} V_t + \Delta(S_t,t) \text{d} S_t$. We then choose $\Delta(S_t,t) = - \frac{\partial V}{\partial S}$ and then by substituting this into the above formula and using self-financing, we quickly obtain a riskless portfolio and the Black--Scholes PDE follows from there.



The point that confuses me is that it is not clear to me that we can definitely construct a portfolio satisfying $\Pi_t = V_t - \frac{\partial V}{\partial S} S_t$ which also must satisfy $\text{d} \Pi_t = \text{d} V_t - \frac{\partial V}{\partial S} \text{d} S_t$. Every text I can find simply assumes that you can and proceeds as above. However, the existence of such a portfolio implies that $\frac{\partial V}{\partial S} S_t = \int_0^t \frac{\partial V}{\partial S}(S_u,u) \text{d}S_u$ and I don't see that this is necessarily true, that is to say, I don't see how such a portfolio can exist? What am I missing?


The interesting thing is that I have followed a different derivation of Black--Scholes where the portfolio instead consists of some amount of the underlying and some amount of a risk-free instrument $B_t$, i.e. $\Pi_t = \alpha(S_t,t) S_t + \beta(S_t,t) B_t$. Here we choose $\alpha(S_t,t) = \frac{\partial V}{\partial S}$ as before to remove the risk but this time the freedom in $\beta(S_t,t)$ seems to mean that we can ensure the portfolio is self-financing and therefore I am happy with this version of the argument.


I would really like to understand both arguments and where it is that I am going wrong in the first so any help is gratefully appreciated!




forms - Are verbs necessary on field labels for a survey?


This is slightly different than this question regarding a small form. I have a multi-page survey that can take up to 10 minutes to complete.


Right now, all of our prompts start with verbs, but I feel like they may be unnecessary. What are the best practices for when and when not to use verbs? Do some demographics prefer verbs?



This is an example page of our survey: Web Form with verbs in label



Answer



No, just use the label for what is expected. It's easier to understand and clearer to the user if you use fewer words. Think of a registration form:


Enter your e-mail address:


or


E-mail:


From a user experience perspective, the more you cut down on the number of words, the better. Key words are preferred, since they convey the actual meaning to what you want to have added. It touches the accepted answer to the question, "Why shouldn't we use the word 'here' in a textlink". Select, enter, type or write are (in this context) useless words which should be avoided.


Think and apply "Less is more"


forms - Name on card, or Card number first?


We have a fairly simple credit card form on a public website for users to add a new card, but in the process of adding support for American Express we found they require the collection of the "Name on [the] card" and validate this data.



┌─────────────────────────────────┐
│ │
│ Card number │
│ ┌───────────────────────────┐ │
│ │ │ │
│ └───────────────────────────┘ │
│ │
│ Expiry date │
│ ┌────────────────┐ ┌────────┐ │
│ │ 1 - January ▼ │ │ 2016 ▼ │ │

│ └────────────────┘ └────────┘ │
│ │
│ Security code │
│ ┌───────────────────────────┐ │
│ │ │ │
│ └───────────────────────────┘ │
│ │
└─────────────────────────────────┘

While adding this, we actually ran into a bit of a debate about what the most user friendly way to collect this information was.



Idea 1


The first group argued that the "Name on card" field should go before every other input in this set so that numerical inputs were all grouped together rather than having a numerical input, then an alphabetical input, then numerical inputs again.


Idea 2


The second group argued that "Name on card" belongs after the card number because that's the way it physically appears on many cards.


Idea 3


The final group argued that taking the second idea a step further, the "Name on card" field should be hidden until a card number matching American Express has been typed, then immediately appear bellow the card number field (by javascript) to help reduce the amount of input for cardholders who don't actually need to enter this extra information.




So I pose the question, where is the most user friendly place to ask for the "Name on card" in the ordered process of filling out such a form. What makes that way superior to other methods? Is it better to modify the form adding fields conditionally and minimize the amount of input required in the general case?



Answer



Short Answer



Ask for the name after asking for the credit card number, adopting either idea 2 or 3.


Long Answer


I recently did some admittedly basic research into this question.


The reason for this research was that I had noticed the incidence of online credit card forms not requiring the "name on card" field seemed to be on the increase. This pattern was curious to me from a UX perspective because we had been getting feedback from users that not having the "name on card" field was a little offputting because it was unexpected (that is, they expected to be asked for the name that appears on the card).


This topic also interested me because I was wondering whether not asking for the name on the credit card would in fact create a perception among users that the site was not as secure?


Anyway, I did an online search of sites (119 in total) that sold products/services online, and the results are summarised below:



  • 52.94% of sites (i.e. 63 of the 119) required that a name was provided

  • 47.06% of sites (i.e. 56 of the 119) did not ask for the name



Of those sites that did ask for a name:



  • 77.78% (i.e. 49) asked for it after the credit card number

  • 22.22% (i.e. 14) asked for it before the credit card number


Because most sites that are asking for a name seem to be doing so after the credit card number, there will be an increased familiarity with this approach. As such, that's how I would do it also. Why? Because familiarity breeds expectation, and this usually leads to a better user experience because it matches what users are expecting. Here is some further reading to back this assertion up:



I would argue that you don't want to step away from a familiar approach unless you have something that is significantly better and therefore warrants the change. Plus or minus one field probably doesn't mean a lot in the end.


Note




  • Unfortunately I did not measure how many of the sites accepted American Express cards, and that would have been more applicable to your situation because American Express cardholders may have a different user experience to other cardholders.

  • All sites were based in either the US, Canada, UK, Australia or New Zealand, so there is an inherent bias in the results in that all sites were based in western english speaking countries. That is, I cannot verify whether these findings would be repeated if selecting sites in, say, Asian countries for example.

  • In a number of cases, the sites asking for a name did so in a separate step to the one asking for the credit card number. That is there was a separate step that asked for details such as Name, Billing Address, etc. In these cases, the order of the steps dictated whether they counted as asking for the name before or after the credit card number but only if the field actually asked for the "name on card" or something similar. If it was just asking for your name, then this was not counted as wanting the name on the credit card.

  • I suspect that the increased incidence of sites not asking for a name is due to the fact they're only accepting Visa or MasterCard. So, from this perspective, you could implement your third option and when doing so, ask for the name after the credit card number.


checkboxes - nested checkbox behavior check/uncheck


I have a hierarchical category tree and checkboxes next to each item that allow to enable/disable the correpsonding category.


enter image description here


I assume it is an expected default behavior that all subategories of natural environment become checked when I check the natural environment category. But what about unchecking it again: Should this automatically uncheck all subcategories or restore the previous state in case some were checked already? Furthermore... Should unchecking one of the subcategories cause the parent category to become unchecked?



Answer



This is a common pattern for users.





  • If a subset of child items are selected, the parent item indicates partial selection.




  • If the parent item is clicked while in the "partial" state, all child items will also be selected.




  • If the parent is deselected, all child items will be deselected.





Clicking a parent item to select all children


modeling - Shortcomings of generalized Brownian motion for asset price modelling


I'm simply interested on hearing some views on which shortcomings arise by using the (multidimensional) SDE $$dS(t)=S(t)\alpha(t,S(t))dt+S(t)\sigma(t,S(t))dW(t)$$



as a model for asset prices.


I know this is indeed quite general question, but I've often encountered this in my studies and most likely you guys have a lot more insight into this than I can figure out myself.



Answer



I would like to add a few more points to @Phun's already very good answer:


The question is interesting because generalized Brownian motion already covers a lot of cases:



This example includes all possible models of an asset price process that is always positive, has no jumps, and is driven by a single Brownian motion for each asset.


(Shreve, Stochastic Calculus for Finance II, p. 148)



Shortcomings:




  • Brownian Motion is continuous, i.e. no jumps in the stock price paths.

  • It cannot become zero, whereas companies can default.

  • The likelihood of large price movements is smaller than observed in real markets. See for example Mandelbrot's criticism.

  • The distribution of relative movements following the normal distribution is symmetric, in practice a common pattern is: many small movements up, and fewer but larger movements down.

  • In practice large movements tend to be clustered together, followed by long periods of little movements, i.e. no regimes. See for example "The clustering of stock price movements", by Malkiel et al., 2009.


Wednesday, August 28, 2019

website design - Should "Printer Friendly" buttons be used?


I have an intranet application that has a few "printer friendly" buttons on pages users were expected to print, and I really would like to get rid of them. The previous designers didn't know what they were doing and the print buttons are a particularly ugly example. In my opinion Printer Friendly buttons just make the layout that much more erratic (they're on very few pages), the print version as-is looks nothing like the normal version, and I would really rather print by CSS.


In fact the default print settings in most browsers actually make my pages look 90% okay in print, all the print button is doing is removing the navigation buttons and all styles; this has the effect of destroying the user interface and forcing the use of the back button.



So is there a reason I should keep these? I hate to just do it for "consistency's" sake, because the behavior is NOT consistent. However I do want my users to be able to print, and I don't want them to think that without those buttons the printout won't work or that it will be ugly. Do people even use these buttons? Is there any research on them? Any recommendations are welcome. I have barely seen "Printer Friendly" buttons on webpages (outside of news articles) in years, I was hoping they had fallen out of favor.



Answer



'print friendly' functionality is a bit of a hold-over akin to 'font resizing' widgets. It was an attempt to take somewhat hidden browser tools and bring them into the UI of the page itself.


The thing with print-friendly, however, is that it can serve purposes other than printing. The typical alternate use for a print-friendly link is on news sites or content-heavy sites. Typically the print-friendly version (somewhat ironically) will lead you to a much easier to read version of the page even on-screen. Typically it's now one page, no ads, and 100% width allowing you to resize your browser to your preference.


Print CSS supposedly makes the need for print-friendly links unnecessary. Technically, it works well, but there can be UX issues as well...namely that one can end up printing a page that looks very different than what they see on screen. This can be disconcerting to folks at times.


So, no easy answer, unfortunately.


In your specific situation, where the screen version isn't really different than the print version, I say the print friendly links are superfluous.


Tuesday, August 27, 2019

How to calculate bond yield in QuantLib - Python


I want to calculate yield of bond having market price and coupons. I try to replicate C++ from (https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/) in Python but without success. How to use "bisection" solver in quantlib-python?


solver = ql.Bisection()

solver_max = 0.5
solver_min = 0.1
solver_maxEvaluations = 1000
solution = solver.solve(?, solver_maxEvaluations, solver_min, solver_max)


NotImplementedError: Wrong number or type of arguments for overloaded function 'Bisection_solve'.
Possible C/C++ prototypes are:
Bisection::solve(PyObject *,Real,Real,Real)
Bisection::solve(PyObject *,Real,Real,Real,Real)




What is the "PyObject*" in this case?



Answer



In the call to Bisection.solve, the question mark must be the Python function whose zero you want to find. In your case, it should be something reproducing the logic of IRRSolver::operator() in Mick Hittesdorf's code, i.e., something like this (which I haven't tested):


cashflows = fixedRateBond.cashflows()
npv = fixedRateBond.NPV()
def price_error_given_yield(rate):
interestRate = InterestRate(rate, ActualActual(ActualActual.Bond),
Compounded, Annual)
return CashFlows.npv(cashflows, interestRate, False) - npv


irr = solver.solve(price_error_given_yield, accuracy, guess, min, max)

The idea is that you write a function that takes a yield and tells you how much the corresponding price differs from the target price; the solver takes the function and returns its zero, that is, the value of the input yield for which the result (i.e. the difference from the target price) is zero.


This said, Mick's approach is useful for educational purposes but it duplicates functionality that is already available from the bond object. All you need is to call


fixedRateBond.bondYield(targetPrice, ActualActual(ActualActual.Bond),
Compounded, Annual)

Note, though, that the targetPrice above should be the clean price, so in your case what's returned by fixedRateBond.cleanPrice() rather than fixedRateBond.NPV().


Monday, August 26, 2019

creative writing - Can I use prominent people in history to as characters in my fiction?


I am a little puzzled. I want to set my story in a real era that happened; like say, the American civil wars during Lincoln's time, and involve the then prominent figures like Lincoln and McClellan as some of my major characters, though portraying them fictitiously; reputation and natures maintained. Has this got to bring me some problem?


Again, my story is historically untrue, but I need to infuse it into a real historical event that might have happened and let it make part of the event; can this work? Please help me know.





page layout - Should the F-Pattern be considered in all designs?


The F-Shaped pattern is a pattern found in an eye-tracking study as the primary areas people glance over when reading a website.


http://www.useit.com/alertbox/reading_pattern.html


Is this something we as graphic designers should consider not only in web but in all mediums? If so do we give priority placement to our content for maximum benefit to our end-users or to advertisers/sponsors for maximum revenue?



Answer



I'd say it depends on your goals. If speed of getting information is your top priority, then probably yes. If you seek to delight, impress or surprise users, then better think of it after achieving what's more important.


tables - Is there a better way than zebra stripes


Currently we are working on a project that includes many datatables. Before deciding to use zebra stripes to make datatables easier to manage, I wanted to ask if you could advise a better solution than it.




How can I change the perspective of an object Illustrator CS5


I have a flat object.


I want to fit it on a laptop screen. I can't use the perspective grid because it only deals with a straight line axis and the screen doesn't have any edges on a straight line.



I can't find a way to rotate or skew the perspective grid.


If I skew the object it doesn't work as I need to make each corner skew independently.


In Photoshop I can use Transform > Perspective. Does Illustrator CS5 have a similar function?


I want to put the recycling symbol on all three screens. What's the easiest way?


enter image description here



Answer




Does Illustrator CS5 have a similar function?



Yes. But it's sort of hidden in CS5....






Select an object and grab the Free Transform Tool


enter image description here


Now.. in this order.. you must follow this order....



  1. Click a corner handle (but do not move the handle)

  2. Hold down the Command/Ctrl+Option/Alt+Shift keys

  3. Drag the handle



This will create a Perspective Distortion on the object as you drag.


Again, this only works if you follow the specific order of steps above using the Free Transform Tool. This won't work with the standard bounding box or any other tool.


This is a CS6 animation, which is as close to CS5 as I can get on my systems.


enter image description here





The Free Transform Tool (e)


enter image description here


If you click the tool, you are presented with a popup tool bar... Perspective Distort is on that popup...


enter image description here



Click the Perspective Distort Tool and then click-drag a corner handle on the object you wish to distort.


-- The shortcut posted above for older versions will also still work in any newer version of Illustrator -- and the order of the steps still must be followed.




Be aware you can not distort linked/embedded raster images with this. These tools/shortcuts only work with native vector objects and/or groups. To distort linked/embedded raster images, see Andrew's method in the other answer.


adobe indesign - How to create a document with alternating (left and right) master pages without working in spreads?


I am creating a large pricelist with multiple (15) master pages (for example, pages 1–10 have Master A and 10–20 have master B and so on). The end result will bee a saddle-stitched booklet that the printer would like as a single page PDF, but my problem is that I can not use the benefit of left and right master pages unless I use spreads in my document.


So my problem:



If I want the odd and even pages to have alternating master layouts (i.e., so the page number is always in the outside corner of the booklet), I need to set up the document in spreads (or facing pages) then I do not have get bleed down the centre of the spread from page to page which I need when sending through to the printer.


Is the only way to do this by creating master pages for the left and then for the right and then applying them manually to the document?


I hope this made some sense, as it confused me even trying to explain.


EDITED QUESTION:


So if I were to change the document to have facing pages (which it does not currently because I wanted to have bleed on all sides). Remembering when it comes to printing (as the document is going to be saddle-stitched) the pages on the working document will not be on the same sheet in the booklet.


If I am to have the 3mm inner bleed the example below shows what happens, as expected it picks up the opposite page on the spread (which for printing purposes would not be on the same sheet):


example two


If I take off the inner bleed and have no bleed at all (see image below), yes this does work but then the document has no bleed on one side (the right in this example):


example three


Maybe I am getting too caught up with bleeds, but for the sake of having bleed on all sides? Anything that I am missing here?





Sunday, August 25, 2019

options - At-the-money and volatility smile


In a volatility smile; why is the ATM point usually or ideally at the bottom? In other words, why is the "smile" smile shaped as opposed to another shape?




navigation - Where should a 404 page link back to?


This might be a no-brainer but I can't decide whether the 404 error page should link back to the page, from which the user has come, or should it direct to the main page where the user can navigate to any part of the site? Making links to previous pages is really hard to implement since I will need to incorporate some sort of session cookie or something to track the previous URL.



Answer



Well I think I just found the answer to my own question but I'll be glad to listen to other inputs too ,I believe having a sitemap of the various links on the site would help or atleast a sitemap of the main pages on the site (if the site is too large to have a full fledged sitemap on the 404 page)


Heinz ketchup does this really well


Direct link here


Direct Link here



Photoshop: How do I create a new layer from a shape that I wish to draw?


When I try to draw a shape, I can't seem to get it to create a new layer, but rather it always goes on the layer that I already have selected. How do I create a new layer from a shape that I wish to draw? Otherwise, I can't seem to edit its colour....


In relation to this, I watched a tutorial and each time the guy drew a new shape it created a coloured thumbnail linked to a thumbnail with the shape inside of a grey box. For me, currently, the shapes just keep appearing on transparent layer thumbnails.


This is what the tool bar looks like with the shape tool selected:





Saturday, August 24, 2019

Mapping all colors (except background) to a single color in GIMP


I have a spotty image. The image has maroon and black spots (with gradient) on a white background. I would like to convert every color (except white) to green color using GIMP.enter image description here



Answer



As AndrewH mentioned, since the background is plain white, you can select it and invert the selection, then fill it with the color you want. Here's how.




  1. Choose the "Select By Color" tool and click on the white background.




  2. In the menu bar, go to "Select->Invert"(the shortcut is Ctrl+I).





  3. In the menu bar, go to "Edit->Fill with FG Color" making sure the foreground color is the color you want. If you want to still keep the original image as it is in it's own layer, create a new layer, then fill the selection.




Result


adobe photoshop - Resize (enlarge) an image without resampling (in favor of quality loss)?


How to resize an image or selection without resampling the pixels? I have some pixel art that I want to enlarge without losing the hard, non-anti-aliased, pixel edges. In other words, 1px should become 4px of the same color— fake big pixels. Is there any way to achieve this procedurally?


Example (of what I don't want):


before resize:


before



after resize:


after


Open to other tools/methods beyond photoshop, thanks in advance.




Story length and the term used


At what page number would a short story become a novella and at what point does a novella become a book manuscript? Is there a specific length that the story has to be to achieve to use those terms?




Replicate InDesign duo-tone in Photoshop


Hi First question here!


I've inherited a design from a previous designer which utilises a grayscale image which is placed in InDesign as grayscale then coloured as cyan and the container coloured as yellow (0,10,100,0). What it produces seemingly uses cyan as black and yellow as white. As you can see here:



enter image description here


The closest I've got is two layers of monotone with multiply effect. The colours are inverted. It's pretty close but not exactly the same.


enter image description here


I would do all the images in indesign if I could except the client has asked for photoshop droplets so that they can chose their images at a later date.


Thanks for having a look guys.




Friday, August 23, 2019

How can graphic designers contribute to Open Source projects?


I want to participate in Open Source projects, but I cannot code (that well. Or.. at all).


I would love to contribute to GitHub projects, but as a designer I'm not sure what's the best way to do this (I mention GitHub because it makes it really easy to find stuff which is already happening, but any platform would apply).


What's the place of a graphic designer in the Open Source world, or what are some good practises when deciding to join a project of these characteristics?



Answer



The most important thing is to find a project who's goals you really support. I'd hate for open source work to become a chore, you should quit if it does, and you're more likely to create good work for something you're passionate about. Hopefully the project itself won't die out quickly, because you want to make something that lasts.


Once that is established, you should reach out to the creator(s) and talk to them. Since it's open source, their information is likely clearly visible. I'm sure they'd love for you to help out however you can, and by talking to them and asking, they can tell you exactly how you could help out best.


As for what that may look like, they'd likely be having you do something along the lines of the following (assuming they have work that a designer can do - it's not just code, but includes some type of interface, at least a splash page for people looking at the project):



  • Critiquing their project's usability


  • Critiquing the layout / flow

  • Coming up with a color scheme or even the visual identity of the application

  • Finding new ways to improve the user experience, whether it's improving their copy, adding transitions, creating a creative 404 page, or some other little gem that users would enjoy but not expect. I think this is would be one of the most fun things for you to create and (assuming the basics of the application's design are covered) one that has the biggest end effect

  • Choosing a better typeface

  • Creating a logo

  • Coming up with a new design/layout for components or even the entire application

  • Coming up with alternative themes

  • Implementing the design in the languages used (even if this means you learn it) - this would put you in the role of a front end developer


In addition, there are many design-specific open source projects that help developers. These can range from image libraries (both photography and illustration libraries), to fonts, to templates, to grid systems, to something else entirely. The purpose of these are to make developer's jobs easier and to offer resources so that companies don't have to do everything from scratch by themselves.



What you end up doing, of course, depends on how involved you want to be, the skill set you have, and the type of application you're working on, but I think this answer gives a good idea of what some possibilities of work for you are. It really is the same type of design work you'd be doing for work, just (perhaps) for a better cause.




As Scribblemacher commented, using open source programs and being active in their community by posting tutorials, sample works, templates, questions, new scripts, and feature requests regarding the program helps the application get better. This is something that you could be doing in your regular workflow and is an integral feature of any open source project.


options - Expected payoff at future time



Let $a$, $b$, $c$, and $e$ be constants, $W_1$ and $W_2$ be Brownian motions with correlation $\rho$, and $f(t)$ and $g(t)$ be deterministic functions of time. Let $X$ satisfy $$d(X(t))=(aX(t)+ef(t)g(t))dt+f(t)X(t)dW_1(t)+g(t)X(t)dW_2(t).$$ Compute the expected value of $X(T)^2$ given $X(t)$ for some $0\le t\le T$.


If $e=0$, we can use Ito's rule to write $d(\log X)$ as an expression independent of $X$. Integrating gives that $X(T)|X(t)$ is log-normal. If $e\neq 0$, $d(\log X)$ is no longer independent of $X$. I can't think of a way around this issue.



Answer



Based on ideas from this question, let \begin{align*} M_t = e^{-at+\frac{1}{2}\int_0^t (f^2+g^2+2\rho fg)ds -\int_0^t(f dW_1(s)+gdW_2(s))}. \end{align*} Then \begin{align*} dM_t = M_t\Big[\big(-a + f^2+g^2 + 2\rho fg \big)dt - f dW_1(t)- gdW_2(t)\Big]. \end{align*} Moreover, \begin{align*} d(M_tX_t) &= M_t dX_t + X_t dM_t + d\langle M, X\rangle_t\\ &=e M_t f g dt. \end{align*} Then, \begin{align*} X_T = \frac{M_t}{M_T}X_t + e\int_t^T\frac{M_s}{M_T} f(s)g(s)ds. \end{align*} Now, you should be able to compute the conditional expectation.


pixel - Is there a resource that documents all mobile device screen resolutions in one location?


I could not find a complete guide of this nor did I know who to contact about possibly making a wiki here for it (if it exists or not allowed please remove). I cannot nor want to remember everything in regards to pixel dimensions when designing for mobile devices but I'd like to have a list of the pixel dimensions for:


Device                                  Width   Height


Apple iPad
Apple iPhone 3
Apple iPhone 4
Apple iPhone 5
Apple Mini
Google Nexus 7
Asus Transformer Pad Infinity TF700
Google Nexus 10
Asus Transformer Pad TF300
Samsung Galaxy Note 10.1


If someone knows a complete guide for all major tablet and mobile devices that would be great.



Answer



I've found the iOS specifications in one single page, it's hard to find all resolutions in one single place, because the list is growing up everyday, and some of them becomes obsoletes soon, but fortunately that information is not hard to accomplish, as soon as you need to now one, is just a Google search far from you, and you could create your own list with some time.


This is the iOS cheat sheet of resolutions, I hope it helps. http://ivomynttinen.com/blog/the-ios-design-cheat-sheet-volume-2/


Mass Market Data Source


My current project requires large amounts of historical and real-time market data (1m or 5m bars for various products, mostly US futures for as far back as available). This data will be analyzed by software, so accessing the data through the internet for each price is not going to cut it, we need local data for speed.



There are many online data sources, but do any offer downloading of consolidated data rather than requiring a separate request for each price? Also, are there any recommendations for one to use in conjunction with Interactive Brokers?




CDS Mark-to-Market


I am trying to calculate the Mark-to-Market of a CDS, and I want to know if what I did is correct.


Let a CDS of maturity $T$, we suppose that the recovery $RR$, the discount rate $r$, and the hazard rate $\lambda > 0$ are constant. The default time $\tau$ is defined such that $\mathbb{P}(\tau > t)$ $=$ $e^{-\lambda t}$. Let $0 = T_0 < ... < T_N = T$ the contractual payment dates. We ignore the payment accrued.


I'm going to calculate the fair spread $s$*, this is the spread such that $PVPremiumLeg = PVProtectionLeg$. We can write the present value of the premium leg of an existing CDS contract as :



$PVPremiumLeg = s\sum_{i=0}^{N-1} (T_{i+1} - T_i) \mathbb{E}[e^{-rT_i}1_{\tau > T_{i+1}}] = s\sum_{i=0}^{N-1} (T_{i+1} - T_i)e^{-(r+\lambda)T_{i+1}}$. We also suppose that the premium payments are continuous. So :


$PVPremiumLeg \simeq s\int_{0}^{T} e^{-(r+\lambda)u} du = s \frac{1-e^{-(r+\lambda)T}}{r+\lambda}$


If we suppose that the protection leg is payed at the defaut time $\tau$, we have, $PVProtectionLeg = (1-RR)\mathbb{E}[e^{-r\tau}1_{\tau \le T}] = (1-RR)\int_{0}^{T} \lambda e^{-(r+\lambda)u} du = (1-RR) \frac{\lambda}{\lambda +r}(1-e^{-(\lambda + r)T})$


We deduce that the fair spread $s$* is $s$* $= (1-RR)\lambda$


Now we want to compute the Mark-to-Market (protection buyer point of view) of this CDS, at a time $0 < t \le T$.


We have $MtM(t) = PVProtection(t) - PVPremiumLeg(t)$. But at this time $t$, we know that the market spread (the spread quoted in the market) $s_t$ is the spread which makes the Mark-to-Market of a new CDS (of maturity $T$) starting at time $t$ equal to $0$, i.e $PVProtectionLeg(t) - s_t\frac{1-e^{-(r+\lambda)T}}{r+\lambda} = 0$.


So $PVProtectionLeg(t) = s_t\frac{1-e^{-(r+\lambda)T}}{r+\lambda}$. And then we conclude that :


$MtM(t) = (s_t - s_0)\frac{1-e^{-(r+\lambda)T}}{r+\lambda}$ with $s_0$ the contractual spread.


I want to implement this MtM function in $R$. My question is how do you calibrate the $\lambda$ ? Do we still have $\lambda = \frac{s_0}{1-RR}$, or do we calibrate it at each time $t$, i.e $\lambda_t = \frac{s_t}{1-RR}$ ? Thank your for you answer and sorry for my poor english.


Adam.





models - Implementing a Fast Fourier Transform for Option Pricing


So, I'm in need of some tips regarding a small project I'm doing. My goal is an implementation of a Fast Fourier Transform algorithm (FFT) which can be applied to the pricing of options.


First concerns:


-which FFT, there are a lot of differents Algorithms, which can be called FFT, the most famous one being Cooley-Tukey I guess.


My thoughts on this: I prefer the most simple one, since this is no thesis or a big project, just a course on Algorithms. But it has to be compatible with option pricing (in contrast with the most -well in our general literature- referenced application of images/sound processing). So it depends on the form of input that is provided (on which I need some advice). I'm familiar with the several improvements, like a Fractional FFT, mixed radix FFT etc. But these seem pretty complex and optimization/performance driven, which is not relevant for my project.



-which Pricing model:


I Guess Black Scholes is a bit too 'flat' and I am aware of the several models that emerged after BS. So with the same objectives as stated above I'd initially prefer the Heston model.


There are a lot of considerations, and truth is I just can't see the wood for the trees.


Some background info:


My background is a B.Sc in Mathematics (Theoretical), so I have some understanding of fourier transforms. Goal is a working FFT implementation for caclulating option pricing.


(!)It does not have to be the fastest (no extreme optimization). Goals are trying to understand the chosen FFT and having a real-world working application.


So could you give some advice on the choices?


I've read a lot of papers on FFT + Option pricing, say all the decent hits on googles first few pages. But those studies were written with a much 'higher' cause.



Answer



I would say





  • Start with Black Scholes to look at accuracy. In particular, you have a closed formula and you know what the characteristic function for lognormal is. Running FFT and comparing FFT pricing with the closed formula will give you an idea of what are the convergence issues, what is the behaviour at the boundaries (extreme strikes) etcetera.




  • Then step forward to Heston with no correlation. In this case many people don't even bother with FFT but use Gauss-Legendre (or Gauss-Hermite or Gauss-Lobatto). Again, running FFT versus these alternative methods will teach you some lessons about convergence etcetera.




  • Finally try Heston with correlation and some simple Levy model like Variance Gamma for example and compare with a PDE implementation.





In my opinion a pricing algorithm is worth talking about only if it is superior to all the others. That's why if I look at an algorithm the first think I want to know is how it compares with the others, what are its limits and its strenghts.


correlation matrix - PCA on term structure of interest rates


Interest rate time series seems to be non-stationary whenever test is performed


But covariance or correlation matrix is derived from term structure time series which are non stationary and later PCA is performed on that covariance or correlation matrix.



Is it appropriate to derive Covariance or correlation matrix from non stationary series and use it for PCA?


Applying Kalman filter on term structure of interest rates is any better than PCA?



Answer



If you look at changes of the points on the yield curve, then you probably find something stationary - right? Applying PCA on the covariance of these changes makes sense.


E.g. you will find out that on PC describes a parallel shift (a change in the yield curve). Look at this question too: What do eigenvalues/eigenvectors of the yield/forward rates covariance matrices mean?


metro - Are there any statistics on what orientation people prefer to hold tablets at?


I was just wondering if there was any statistical study about what orientation (landscape or portrait) people to prefer to use on their tablets.


I am working on designing a metro app and a feedback was given that the portrait orientation could be used to show the expanded view of a selected item and I was wondering if that would be commonly accepted behavior since my initial understanding was that orienting to the portrait orientation should just show a condensed view on the relatively smaller screen space




Thursday, August 22, 2019

print design - What term is used to refer to cut vinyl stickers?


I'm looking to have a decently sized run (anywhere from 100-1000, depending on cost) of stickers made using my company's logo. My standard sources for vinyl stickers don't seem to have options for cut vinyl stickers, so I'm looking for a new source.


The difficulty is that I'm a little unsure what the process is called. I'm going with 'cut vinyl sticker', but maybe they go by something else in the industry.


This image shows the type of sticker I'm looking for:



LabelPhoto Note: the sticker shown was two single-color stickers that I put together. I'm not expecting to find someone to do more than a 1-color run.




mobile - Should users be forced into a responsive design (without the ability to opt out)?


There is nothing worse than getting automatically redirected to a mobile version of a site, and not having (or not easily finding) a "view normal site" link. It's not just that the mobile site is a scaled down version of the normal site, it's the unfamiliarity - the sudden 1-dimensionality of what used to be a 2-dimensional page and the obscene amount of scrolling required. The previous mental map of the site is no longer accurate.


On the Boston Globe site (the oft-cited shining example of responsive design), I find the amount of scrolling to be extremely painful if I am not looking to read in a linear fashion. With the retina display on an iPhone, the desktop version would be discernible and immediately navigable with a quick tap-zoom to any location of the page. As with most responsive designs, the "view normal site" option is not available.


Should users be forced into a responsive design? Should they be able to toggle if off to "view normal site"?


Below are the estimated viewport overlays of an iPhone on the Boston Globe site at each view:



enter image description here


=== Update 2012-09-12 ===


Some prototypes have emerged recently:




Answer



Yes, you should allow users to escape it.


The Boston Globe redesign was handled by Ethan Marcotte, who wrote the book on responsive design. Combined with the CMS nature of the site makes it perfect for deployability, usability, and flexibility concerns with responsive designs.


Each viewport has to morph content to promote, demote, and generally rearrange content. If you design (and test) it correctly, you could meet the needs of the majority of your users. For everyone else, I'd suggest breaking out of the media queries to a larger one (somewhere between min-width: 1000px and 1200px). To not enable this option is to assume that you're offering everything that your normal site has in a smaller format, and in most responsive designs, that really isn't the case.


For desktop users visiting on mobile, they are absolutely locked into the viewport with no recourse; this can be inherently frustrating for some users. There may be other issues like newer devices that are displaying the wrong viewport or generally haven't been covered by media queries, making the design suboptimal - in that case, fall back to the native device's rendering of the page.


Edit (8/13/2012)



I spoke with Ethan about this issue, and I think we agreed. Good responsive designs shouldn't trim features or content from the "desktop" viewport. With the introduction of frameworks such as Bootstrap, I think the issue we're seeing is very poorly done responsive sites that hide certain functionality (such as nav menus) because the designers/developers haven't approached responsive design in the ideal way.


In addition, new devices, browsers, and even PPI/high resolutions may render a responsive website in weird ways. These instances should be rare, as the best responsive sites are not designed for devices/breakpoints but rather ANY canvas, but allowing users to break out to 960px or so is a good fallback.


How do I export a complicated floorplan and ductwork from CAD to Adobe Illustrator in vector format (without freezing/crashing Illustrator)?


I've tried lowering the quality of the plot in CAD but that makes the curves so bad it's unusable. Every time I try and open the exported file in Illustrator it takes forever and if/when it loads if I click anywhere on the screen it takes forever to process. Each edit on the document takes 20 to 30 minutes at least.





How does an option's time value depend on moneyness?


How does an option's time value (also known as extrinsic or instrumental value) depend on how far it is in the money or out of the money? In other words, how does the time value change as the underlying price changes?



Answer



By definition, an option's premia is the sum of intrinsic value and time value. The time value of premia declines as the option goes more ITM ("in-the-money") or OTM ("out-of-the-money"), ceteris paribus.



An intuitive explanation for this can be found by thinking of time value as the expected P&L of a long option position dynamically hedged by going short (long) Delta units of a call (put). Delta is the sensitivity of the option premia to the price of the underlying. It is a value between 0 and 1 and increases with moneyness. Delta of an ATM ("at-the-money") option is approximately 0.5. Suppose that you are long 100 ATM calls struck at X and delta-hedged by being short 50 units of the underlying at price S=X. If S goes up to S', your option is ITM and delta goes up as well--let's say to 0.6. Now, to be hedged, you have to sell 10 more units of the underlying at S'. Now suppose that the price goes back from S' to S. Delta decreases back to 0.5 and you have to buy back 10 units of the underlying to be hedged again. You have made a S' - S profit on 10 units by holding a market neutral position. Over the interval of time between re-hedges, your delta-hedged position gets long in an up market and short in a down market, and as you re-hedge you are realising little profits from the re-hedges as the underlying goes up and down in price.


This is a valuable property to have in a position that by construction takes no market risk. But there is no free lunch, and time value can be thought of as the price you have to pay in order to have exposure to this delta-hedging P&L over the life of your option position. (It is also why time value increases the more volatile the market expects the underlying to be--Implied Volatility--and time value erodes as the option's expiry gets closer. The sensitivity of option's premia--and therefore time value--to those two factors are called Vega and Theta, but that is another discussion.)


So why does time value decline the more ITM or OTM the option is? The reason is that the change in Delta given a change in underlying price is not linear, but is rather a convex function of price. The change in delta is greatest when the option is ATM, but as the option goes more and more ITM (OTM), Delta gets closer and closer to 1 (0) and the changes in Delta get smaller and smaller. Therefore, so do the little re-hedging profits and so does time value. Delta-hedging a deep ITM or OTM option doesn't generate much P&L for the simple reason that Delta doesn't change very much.


The sensitivity of Delta to a change in underlying price is called Gamma, and Gamma is the reason why time value is worth so little in very ITM option but worth allot in an ATM option. A more formal answer can be given to your question, but given the nature of the question, I hope that this intuitive sketch will be more illuminating.


error message - Bulk actions: what to do when not all items support an action


Picture the following scenario: user selects a bunch of items, and the 'bulk actions' box appears; user selects an action that not all items support (for one reason or another).


What do you do in this case: apply the action to items that support it? don't apply the action at all and show an error message?


My current ideas are to either:




  • Apply the action to items that support it; for actions that cause the items to disappear (like 'delete item'), I'd leave the offending items behind, still selected, with an error message: "some items could not be deleted".

  • Disable the actions that are not supported by all the items and provide a 'fix this' link that deselects the offending items for the action.


Also, can you point me towards any relevant real-world examples?




fixed income - Closed-form formula for approximate maximum duration of a bond?



In teaching myself about bonds, I am writing some software, one piece of which will calculate the maturity of a bond given the yield curve as a function and a requested duration. The tricky part is that duration depends on interest rates, and the interest rate depends (through the yield curve) on maturity, which depends on duration. That part is working fine for reasonable durations and interest rates, albeit somewhat slowly, simply by iterating back and forth between calculating maturity and calculating interest rates, until a solution is settled upon.


However, another function is supposed to generate a portfolio of such bonds by calling the former function, given an average duration and a std. dev. of the duration of the bonds in the portfolio. Now the paradigm breaks down, since the generator will occasionally request durations greater than the maximum duration of the bond itself. The easiest fix for both functions is to calculate an approximate maximum duration and avoid duration requests that are beyond that limit.


My understanding of maximum duration is somewhat limited, except to say that the duration-maturity relationship is inverted-U shaped and generally not amenable to closed-form solutions. I have only been able to locate one paper on the subject, which is for below-par bonds only. Gross approximations are fine; I just need to be in the ballpark for this application. But closed-form solutions are essential since this check will be run on every bond created (and if I simulate I may create thousands or more over time).



Answer



After struggling through the Pianca paper due to its poor proofing ($F$ is never defined but appears to be face value, and $n$ is implied to be the number of periods remaining but is instead maturity), I seem to have it worked out.


Using the lambertW function in gsl, I have it replicated in R:


# Estimate duration using various closed-form formulae
# Equations 5,6, and 11 in Pianca "Maximum duration of below-par bonds: A closed-form formula"
# Assumptions: flat yield curve, constant coupon, reimbursement value = face value
# r = C/F, or the coupon rate (F is face value, C is dollar value of coupons)

# i = applicable interest rate
# n = maturity date,
# type = "pianca", "macaulay", or "hawawini"
# At par, (i==r)
findDur_ClosedForm <- function(r,i,n,type="pianca") {
type <- tolower(type)
ani <- NA # For hawawini: Need pv of an n-period annuity at rate i
switch(type,
pianca = 1 + (1/i) + ( n*(i-r) - (1+i) )/( r*( (1+i)^n - 1 ) + i ) ,
macaulay = 1 + 1/i - ( (1+i)/r + n*(1+1/r-(1+i)/r ) ) / ( (1+i)^n - 1 - 1/r + (1+i)/r ) ,

hawawini = ( (1+i)*ani*r + n*(i-r)(1+i)^(-n) ) / ( r+(i-r)(1+i)^-n )
)
}

library(gsl)
# Find maximum duration using closed-form formulae
# ... pass-alongs to findDur_ClosedForm
findMaxDur <- function(r,i,...) {
# If above or at par, max duration is 1+1/i
# Otherwise use Pianca formula

asymptote <- 1+1/i
if( i<=r ) { # At or above par
return(asymptote)
} else { # Below par
a <- i-r
b <- log(1+i)
n <- ( b*(1+i) + a*( 1 + lambert_W0( a*exp( -(a+b*(1+i))/a )/r ) ) ) / (a*b)
return( findDur_ClosedForm(r=r,i=i,n=n) )
}
}


Ns <- seq(1,300,1)
Ds <- sapply( Ns, findDur_ClosedForm,r=.001,i=.05 )
plot(Ds~Ns)

r=.001,i=.05


# Numerical optimization from closed form
> max(Ds)
[1] 51.01994
# Maximum according to Pianca's paper

> findMaxDur(r=.001,i=.05)
[1] 51.01998

I have also confirmed through reading through the papers carefully and comparing to exact results that the closed form solutions are all estimates not exact.


Wednesday, August 21, 2019

Font for sections, subsections and subsubsection titles (in scientific thesis)


I've seen in some questions (Fonts for technical reports and What font types are good for a technical document?) that there are many answers to the "what types of font should I use".


Since there is no school template nor policy for thesis writing, I'm thinking about using something like this (which is heavily influenced by the KOMA script bundle for LaTeX):


enter image description here


enter image description here


I'm pretty satisfied with the Chapter title, the inspirational quote and the drop cap. What I would like to know is what type of fonts can I use ---that is in harmony with the complete text and chapter title--- for the section, subsection and subsubsection. Please keep in mind that the numbering must be preserved.




gui design - Should I use customized social buttons


I am facing a cornelian choice.


Should I use custom social sharing buttons for UI consistency or should I keep them original for better recognition ?



Answer




If people don't recognise social sharing buttons they aren't going to use them.


People recognise the logos of their favourite social sharing apps, and you want them to be able to do this as easily as possible so that they are more likely to share them.


If you think that your site looking good is more important than this, then why do you even need them in the first place? Surely it would look better without them messing up your design?


adobe illustrator - How do I import a vector illustration into photoshop?


I've designed an image in illustrator which is made up of lots of vector objects (as drawn with the pen tool), and now I want to manipulate my image in photoshop . I want to be able to edit anchor points as if I had created them in photoshop, and then create derive pretty rastor images at a later stage. I can import my work as a smart object, but if I try to edit it, photoshop opens illustrator and I'm back to square one! I've attempted turning my file into compound images, but there are far too many small objects to do it in this lifetime so I need an alternative. Thanks.



Answer



There is no direct way to move all the paths of an Illustrator file to editable paths in Photoshop witha few easy commands. The best you can do is one path at a time.




  • You can copy from Illustrator, then Paste in Photoshop as a shape layer. But you'll have to do that for each and every path of your Illustrator file, then reposition all the paths in Photoshop.





  • You can export your Illustrator file to a PSD to retain layers. But this will not retain editable vector paths.




  • You can "Place" the Illustrator file in Photoshop, but (as you pointed out) you place as a smart object which does not allow object-level editing within Photoshop.




The question is, why would you even want to? Vectors are sharp, crisp and clean. Nothing you do with Photoshop will result in true vector files. And if you want to apply a buch of raster painting, you may as well rasterize the entire thing.


plot - Decide on a theme/overarching meaning before writing a short story?


I want my short story to have a specific point, to highlight a certain truth. But I wonder in which order I should proceed: make the plot, characters etc. first and worry about fitting my theme into the story later, or start with the point I'm trying to make and build my plot and characters around it?



Of course, the plot needs to be engaging in any case. But my instinct is to build the story around the theme/meaning, and I'm wondering if that is considered a good practice.


A potential downside is that the story will feel more artificial, but the other way around it might feel as if I'm shoehorning in my point into a story that does not support it.


As a response to some of the answers, I might also add that I have a specific theme in mind - so an emerging theme is not what I'm interested in, really.




Monday, August 19, 2019

Have any new stylized facts of asset returns been discovered since 2001?


In 2001 R.Cont stated in "Empirical properties of asset returns: stylized facts and statistical issues" article a set of stylized statistical facts which are common to a wide set of financial assets. The set was later reproduced with minor changes in "Encyclopedia of Quantitative Finance" in 2010.


Here is the set:



  1. Absence of autocorrelations

  2. Heavy tails

  3. Gain/Loss assymetry

  4. Aggregational Gaussianity (later renamed to "Aggregational normality")


  5. Intermittency (later excluded from the set)

  6. Volatility clustering

  7. Conditional heavy tails

  8. Slow decay of autocorrelation in absolute returns

  9. Leverage effect

  10. Volume/volatility correlation

  11. Assymetry in time scales


Have any new candidates into the stylized facts set been discovered since then?




animation - How to prevent unification when animating in photoshop?


I am trying to create an animated gif where text drops down and smashes into the background and cracks it. Whenever I try and transform it though, the transformation is applied to all frames. How do I prevent this? I'm using Adobe Photoshop CS6 (64-bit)



Answer



Layer position and opacity can be animated. The actual pixels in a bitmap layer can not. The solution is to move the layer with the move tool when you want to animate the position, and duplicate the layer when you need to make destructive changes to the bitmap itself.


Sunday, August 18, 2019

Sharpe Ratio - my own calculation differs from Yahoo finance, Morningstar


I am trying to compute the Sharpe ratio for my portfolio. To check that I am doing this correctly, I am first trying to compute it for SPY (the S&P 500 index).


S.R. = mean({SPY return j - risk-free return j})/std dev({SPY return j})

I am using annualized monthly returns that I compute from the SPY index itself. For the risk-free return, I am using the 10-year T-bill. Again, I am using monthly data, same as Yahoo! and Morningstar.


This is how I compute the annualized monthly return for month j:


temp = [ ( (value at month j) - (value at month j-1) ) ] / (value at month j-1)
return for month j = (1+temp)^12 - 1


For some reason, I get 0.61 for the Sharpe Ratio. Yahoo! and Morningstar report it to be about 1.3, again amortized monthly. What am I doing wrong? Here is some sample data:


        S&P price   T-bill price      S&P return   T-bill return
...
Jan-14 176.55 1165.31
Feb-14 184.59 1209.48 0.706417809 0.562739592
Mar-14 186.12 1212.98 0.104125623 0.035283725
Apr-14 187.41 1198.61 0.086417122 -0.133255532
May-14 191.76 1218.43 0.316991962 0.217509175
Jun-14 195.72 1230.87 0.277986402 0.129637856
...


For some reason the computation doesn't work out for me. Can anyone see what I am doing wrong?



Answer



Your approach of computation is not very standard. Specifically, you do not need to compute the annualized monthly return. One can compute the annualized Sharpe ratio from return sampled at any frequency using the following Generalized formula:


$$ Sharpe = \frac{E|R_p - R_{rf}|}{\sqrt{var(R_p - R_{rf})}} * \sqrt{N}$$ where $R_{rf}$ is the benchmark/ risk-free return, $R_p$ is the portfolio return, $N$ is the number of sampling periods in a year. The portfolio return and risk-free rate can be of any interval (daily, weekly, monthly, etc), as long as they are consistent with each other.


In your case, the risk-free rate is effectively 0 nowadays, and N is 12 assuming you are using monthly returns, and N is 252 if you are using daily returns.


Hope it helps.


web app - User Profile, My Account, or just Settings?


I am writing a little webapp, and am stuck on a UI hangup. I have a global menu bar at the top of the screen, that when the user is signed in consists of:



  • Signed in as Joe User (with username as link to account page)

  • My Account

  • Sign Out


My question is about the second item. It takes you to a screen where you can edit your user profile details (name, email, etc.) and change your password. But it will also eventually allow you to do things like upgrade your account to a pay version, enter payment details, manage other users who are attached to your account, etc.


Originally I was going to have a separate 'User Profile' and 'My Account' links, but I think this is way too ambiguous for most users.


Does the whole 'My Account' thing make sense? Would just 'Account' be a more standard way of doing things? Or should I split these back into two?




Answer



Simple is better. And i think the "My" is not necessary.


Authenticated view:



Joe User's account | log out



Not authenticated view:



log in




option pricing - How to choose a risk-neutral measure when the market is incomplete?


I am more of a probabilist than a financial mathematician. I am currently working on the features of American put options under a particular stochastic volatility model.


Like most stochastic volatility models, it is incomplete. (In fact, it would be nice if someone tell me a complete, stochastic volatility model, is there any?) In my current treatment, I have just treated the model as a maths toy. I have chosen an arbitrary risk neutral measure and try to say something about the value of options. (Of course, the proofs holds in any EMM.)


Though the question I asked here is not extremely closely related to what I am doing, I would still like to know:



How does someone choose an EMM? Do you restrict yourself to a subclass of EMM and give yourself some parameters which you try to fit using given data?



Answer



Hum, that's one of the most important questions in financial engineering, that why no answer is proposed.


If you have available data as option prices, you may calibrate a parametric EMM but nothing can tell that it's the best EMM (cause there is no best EMM).


So make a choice and defend your choice by saying 'it's simple and allows beautiful result' like every body use to do.


website design - what's the point of a 404 page?



In my website, if a user accesses an invalid URL, they are shown a custom 404 page. But now I'm questioning the value of this? It would be very easy for me to (instead of showing a 404 page) redirect them back to the home page and display an error message saying something like:



the page you requested could not be found




is this a better approach from the POV of usability?




Saturday, August 17, 2019

Placement of flash/growl notifications or messages in web application


Question



I have been wading through tons of questions on the topic of flash/growl notifications, but none of them touch on where those notifications should be placed and why they should be placed there!


Where is best for the user to take notice of notifications? Where is best for us to display the notifications, but not interrupt the rest of our web app? Should the notifications be inline or fixed?


First, let me clarify the type of notifications I am and am not referencing:




  • I am not referencing form validation summaries or specific form input errors.




  • I am referencing notifications that inform a user of the system's status (heuristic #1 on http://www.nngroup.com/articles/ten-usability-heuristics/). These notifications are not related to anything on the screen, so do not belong near a certain element.





So for instance, after a user edits an item and clicks to Save it, the page forwards back to the list of items, and a notification should appear letting the user know that the Save actually occurred. Or, let's say our web app is polling to see if the user has messages. If the user receives a message, a notification should appear that says so.


Now that I have described the kind of notifications I am referencing, where should those go? Are there principles involved that govern where those should go? I've seen some notifications interrupt the flow of the page, some fixed at the top of the screen, some fixed at the bottom, and some fixed at the bottom left.


Visual Samples




  1. Inline, interrupting page flow


    Inline, interrupting page flow





  2. Fixed, top center


    Fixed, top center




  3. Fixed, bottom center


    Fixed, bottom center




  4. Fixed, bottom left


    Fixed, bottom left





Observations




  1. I don't really like the notification interrupting the flow of the page. It seems out of place and unnecessarily distracting.




  2. From what I've read, notifications in operating systems often appear at the top of the screen, so users may be used to this. But it will block our top header, which isn't great. I'm thinking these notifications aren't important enough to block interaction with our web app.





  3. I'm fairly familiar with notifications at the bottom center. I'm not sure where that came from, but it makes sense to me for them to be there. They are much more "out of the way" down there.




  4. And lastly, I'm also very used to notifications at the bottom left. Facebook is one example of a web app that positions notifications here.





Answer



Jakob Nielsen’s F-Shaped Pattern For Reading Web Content references an important tendency of users when reading websites:




Users first read in a horizontal movement, usually across the upper part of the content area. This initial element forms the F's top bar.



You want your user to see the notification, so the top area of the page within that top bar of the F is ideal. Placing the notification anywhere else means it will be less likely to be seen.


Heatmaps from user eyetracking studies of three websites. The areas where users looked the most are colored red; the yellow areas indicate fewer views, followed by the least-viewed blue areas. Gray areas didn't attract any fixations.


Many popular web apps place their notifications on user performed actions in this area of the page:


Gmail Gmail email deleted notification


Twitter Twitter login error


SB Nation SB Nation login notification


Less important notifications (e.g. not related to feedback on user actions) can be placed elsewhere. Your mention of Growl is a good example of this as are the notifications in Facebook when users like/comment on posts you have had activity in:


Facebook activity notification



numerairechange - Is the money market account (MMA) numeraire and the forward measure equivalent?


Suppose we have a risk-neutral measure $\tilde{\mathbb{P}}$. The money market account is given as $M(t) = e^{\int^t_0 R(s) ds}$, while the price of the zero-coupon bond at time $t$ that matures at $T$ is denoted $B(t,T)$.



So, the forward measure is defined to be the measure with $B(t,T)$ taken as the numeraire. However, I am curious if taking $M(t)$ will also make the measure into a forward measure. If this is not true in general, does it work when the interest rate is constant as $R(t) = r$? This would imply that $B(t,T) = e^{r(T-t)}$, and $B(0,T) = \frac{1}{M(T)}$ and $B(T,T) = \frac{1}{M(0)}$, which seems to imply somewhat of a connection between the two measures just by looking at the Radon-Nikodym derivative, $\mathbb{Z}$.


Also, I have an additional question about the usefulness of the forward measure. It seems that forward measures are useful in options pricing because we can take the discount out for the risk-neutral pricing formula so that $V(t) = D(t) \tilde{\mathbb{E}}^F[V(T) | {\cal{F}}(t)]$. But are there any other advantages of using the forward measure?



Answer



Your questions are nicely addressed in this short paper by Fabrice Rouah: The T-forward measure




More specifically, using your notations and noting that $B(T,T)=1$ by definition, the change of measure between the $T$-forward ($\mathbb{Q}^B$) and risk-neutral ($\mathbb{Q}^M$) measures is characterised by the following Radon-Nikodym derivative: $$\left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t} = \frac{M(t)B(T,T)}{M(T)B(t,T)} = \frac{M_t}{M_T}\frac{1}{B(t,T)} $$


Yet, by construction of the martingale measure $\mathbb{Q}^M$, the following relationship for the price of a zero-coupon bond prevails \begin{align} \frac{B(t,T)}{M_t} &= E^{\mathbb{Q}^M}_t\left[ \frac{B(T,T)}{M_T} \right] \\ B(t,T) &= E^{\mathbb{Q}^M}_t\left[ \frac{B(T,T) M_t}{M_T} \right] \\ B(t,T) &= E^{\mathbb{Q}^M}_t\left[ \frac{M_t}{M_T} \right] \end{align} where I have used the notation $E_t[.]$ to represent $E[.\vert\mathcal{F}_t]$.


Plugging the above result in the expression of the Radon-Nikodym derivative gives: $$ \left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t} = \frac{M_t}{M_T}\frac{1}{B(t,T)} = \frac{M_t}{M_T}\frac{1}{E^{\mathbb{Q}^M}_t\left[ M_t/M_T \right]} = \frac{1/M_T}{E^{\mathbb{Q}^M}_t\left[ 1/M_T \right]}$$


When interest rates are deterministic, then $$ E^{\mathbb{Q}^M}_t\left[ \frac{1}{M_T} \right] = \frac{1}{M_T} $$ and $$ \left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t} = 1 $$ such that the measures $\mathbb{Q}^B$ and $\mathbb{Q}^M$ are perfectly equivalent.


With stochastic interest rates, this is not true any more.



technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...