Wednesday, April 17, 2019

replication - Replicating strategy in the Black-Scholes model



I have a two-asset Black-Scholes model for a financial market:


$dB_t=B_t r dt$


$dS_t=S_t(\mu dt+\sigma dW_t)$


I introduce a European claim $\xi=max(K,S_T)$ with maturity $T$, for some fixed $K$. I have calculated what the no-arbitrage price of this claim should be at each time $t

I know that if $V(t,S)$ is a solution to the Black-Scholes PDE subject to the terminal condition $V(T,S)=\max(K,S)$, then $V(t,St)$ is a no-arbitrage time-$t$ price for $\xi$, and that the trading strategy given by taking initial wealth to be $V(0,S_0)$ and the time-$t$ holding in the stock to be $\frac{\partial V}{\partial S}$ is a replicating strategy for the claim.


If I view the pricing function I originally found (by computing expectations) as a function $\xi(t,St)$, is it necessarily true taking initial wealth to be $\xi(0,S_0)$ and taking time-t holding in the stock to be $\frac{\partial \xi}{\partial S}$ will give a replicating portfolio? It should be, simply due to the fact there is a unique equivalent martingale measure in this market, so there must be a unique no-arbitrage time -$t$ cost for the claim at each time $t$, and so $\xi(t,S_t)$ must solve the Black-Scholes PDE.


My question is, is it possible to prove that this trading strategy does replicate the claim without appealing to the fact that the pricing function solves the Black-Scholes PDE?




adobe photoshop - How to resize vector masks without changing the size-ratio of round corners of it?


Let's say that I have a vector mask of 200px-w 150px-h rectangle with 8 px curved corners.


If I want to resize this to 100px-w 100px-h without changing the size-ratio of round corners, how do I do it without moving the each and every point of the vector one by one with pentool and re-align it with hand?


BTW I know choosing multiple points with shift and moving them together but again this also means doing it for each corner so therefore, 4 times. Is there an easier method? Such as stating the size I want and having it reshaped accordingly with corners intact.


That's what I wonder. I'm using Photoshop.



How can I resize a rounded rectangle vector mask and keep the rounded corners at their correct relative measurements?



Answer



I guess you're talking about Photoshop.


Although you can't scale and keep the nice corners (since PS doesn't see it as a rounded rectangle once you put it on the page), there is a tiny shorter way - Use the white arrow and drag a rectangle over 2 corners together (that's 4 dots) and move them together.


Tuesday, April 16, 2019

point of sale - Why do chip card readers in the US continuously flash messages?


I've noticed that all (or nearly all) the point-of-sale displays that accept credit cards with the chip in the US follow a pattern of flashing different messages during processing. Once the chip card is inserted, it will cycle through various messages like Please Wait, Do Not Remove Card, etc. I find it causes quite a bit of cognitive overhead because each time the screen changes, it may have finished and gone to Remove Card or it may still just be telling me to wait. Although the systems at different stores have different displays and particular messages, they all seem to exhibit this behavior (e.g. comparing Publix, Trader Joe's and CVS).


Why would this design be used over just displaying a constant message while processing? Why do all these systems seem to have this in common? As a side question, is this a US phenomenon or do you see this in the systems in other countries as well?




Answer



The messages instruct the user and gives them feedback that the machine is working.


Sure, a processing message would show what is actually happening, but the user already assumes that. They need to know that they need to wait. They need to know that they shouldn't remove the card. The messages are instructions for the user during the processing. They also represent the requirements of the user for the machine to fully process the card; time and the card in the machine.


By having these messages change, it can direct the user's attention to the message, further reinforcing the requirements for processing the card. This also reinforces that the machine is working. If the display only had one message for the entirety of the processing, the user might begin to think that something isn't working and that it's "stuck". Even if the processing step behind the scenes was "stuck", if the messages displayed to the user continued to change, they may not initially assume that the machine was "stuck" when it takes longer.


statistics - What is the total correlation between assets in a portfolio?



Suppose I have portfolio with 10 assets, each one of them with a weight of 10% from the total portfolio (equally weighted).


It's well known how to measure from historical prices->returns a variance-co-variance matrix. And from here to have portfolio's Variance and STD (and later on this is useful for VaR calculation etc.)


However it's also useful to know the regular correlation (Pearson correlation coefficient) between each pair of assets.


The question is: What is the correct measure to some kind of "Total" or "Average" correlation between all the assets in a portfolio?


Naively because it's equally weighted portfolio I just took simple arithmetic average of all pairwise correlation coefficients...



Answer



This is indeed an interesting question.


According to this website, a paper by Goldman Sachs [Tierens and Anadu (2004)] proposes three alternative methods for estimating average stock correlations:



  1. Calculate a full correlation matrix, weighting its elements in line with the weight of the corresponding stocks in the portfolio/index, and excluding correlations between the stock and itself (i.e. the diagonal elements of the correlation matrix)


  2. Proxy average correlation using only individual stock volatilities and that of the portfolio/index as a whole

  3. Refine 2. by reference to the ratio of index to average stock volatility


You can find more details on the abovementioned website. Unfortunately I haven't found the original paper, but if somebody provides a link in the comments I will update the post.


So to answer your question about a "correct" method: As always there is no "god-given" way how to model statistical phenomena, there are always tradeoffs with certain characteristics which are helpful in some situations but less so in others. Some important characteristics and tradeoffs for the different methods can be found in section 3 (Comments) of the abovementioned website.


creative writing - Scenes with different languages spoken after translation


So... imagine you have a story in your native language written down, with protagonists that speak this language and no problem at all, except a bunch of scenes where your protagonist meets someone who speaks another language. And you write it down in that language. I don't think this is a huge problem at all, even if you assume that your protagonist does not speak this tongue (but the reader may understand it) and you are using this as some kind of a plot element. Everything is fine until now.


Now the unexpected happens: your story is kind of successful and gets published in your country. Now it even amasses more fame and suddenly someone gets the idea to publish it in other countries too... so what should be done with these dual language scenes, especially if it got published in even that language your protagonist has no clue of?


What starts off as



Poor Siegfried was standing around, listening to the foreigner speaking "Ha, der versteht uns doch sowieso nicht, der Depp"



will get to



Der arme Siegfried stand herum, hörte dem Gespräch der Fremden zu "Ha, der versteht uns doch eh nicht"




or (inverse it)



Poor Siegfried was standing around, listening to the foreigner speaking "Ha, he will not understand what we are saying, that moron"



I mean, you can't just flip the language, if you state that this did happen in country whatever before, because readers will get confused if the native language in Germany is suddenly declared to English. For example.


Is there any way to avoid this kind of pitfall, aside from writing



They said in their native German language "that moron will not understand what we are saying" and poor Siegfried indeed did not.






Monday, April 15, 2019

Is there any advantage of signup before login with social plugins?


I am building a site and was thinking about if there should be a signup option at all.


I found the question about the difference between sign up and log in with Facebook/Google/etc but there was neither an accepted answer nor enough responses.


What is the advantage of having to signup using Facebook/Google in the first place? As I see it, a direct login simply would imply checking if the email exists in your database and if not add that info. Since, this would be just a one time operation, I don't believe that a one time insert would take too much time or ruin user experience. Am I wrong on this part?


Then I see many major sites including SO using the signup with Google etc. so there must be something to signup before login.



Can somebody please explain why to sign up users at all?



Answer



However it might be done, logging in and signing up are two different things. The sign up path is almost certainly more complex than the login path, regardless of whether social login or a more traditional login are used.


These crucial differences are not negated just because the technology allows the process to be done in one click.


For example, you may want to do / get your user to do the following on sign up that you wouldn't do on login:



  • agree to your sites terms and conditions

  • enter one off data, such as a date of birth, or consent to your using of such data

  • give them a sign up bonus

  • redirect them to incomplete profile elements


  • pick an image, perhaps from their available social media image uploads, this they might like to repeat again later, but it's not something that would occur on every login


Social signups also give you access to your users social data, which you can't just take without explicit consent - we are all familiar with the 'this app would like access to your x, y and z do you agree?'. You might be able to take the data without them entering it, but you cannot do this (I am not a lawyer, but I have a feeling this would actually be illegal wihtout consent).


Login on the other hand, if done with social accounts, should be one click and in (assuming they are signed into their account of course). As smooth as possible for the user.


Stack Exchange is a perfect example of this. Clicking on a new Q&A site prompts you with a set of social logins, choosing one of which leads you to a reminder that they will use your email address for communication, where as login with a social login just clicks you straight in.


Having said all this, it's perfectly reasonable to have one button: 'connect with facebook' for example; and have your code notice if this is a first time login and follow the sign up path but from the users perspective these paths must be kept distinct.


Critique: logo for a health product


I’d like to know what you guys think about the logo below, there is some debate about the feathers of the tail, they are supposed to evoke an organic feeling, but others say they seem carelessly made.



Should the shape of the feathers be more like the shape of the body (simpler curves and appeareance) or stay the way they look now?


Apart from that what you guys think of the overall design? The product uses vibrations to heal certain ailments of the user.


Thanks.


enter image description here




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...