Content Preview: rss
157 days ago
The fact that the thorny vine finally gave in to the inexorable hunter, as meant to be as it was, still revealed an exciting truth that sometimes the most profund impact could've come from an simple yet benign act, scrubbing away the layer of confusion and contradiction for those who enjoyed the comfort provided so long by various excuses....
250 days ago
The most horrible force in this world is neither the complication of weaponry, nor the great might of deadly army, but the little greed resides in that man's heart. -- He who was not metionable long ago...
270 days ago
To program a simulation in Matlab that is meant to assist in retirement planning. Make the following assumptions: a. You have 30 years until retirement. b. Your income is currently $100,000 per year. c. It will increase at the rate of inflation (r_inf) which is 3% per year (annualized) (so next year, you’ll earn $103,000). d. During each of the next 30 years, you contribute x% of this income to a retirement account. For simplicity, assume that your contribution is made in a lump sum at the beginning of each year. e. You begin with an asset allocation of 60% stocks and 40% (long-term) bonds. During each subsequent year, you reduce the asset allocation to stocks, so that after T years, you have 60-T % in stocks and 40+T % in bonds. (You’ll rebalance your portfolio at the beginning of each year by selling stocks or bonds to ensure that you have the appropriate allocation for that year.) ...
277 days ago
function [S,MeanS]=JumpDiffusionStockEvolution(S0,m,s,lda,pup,pdown,NumPaths) S=zeros(1,NumPaths); x=rand(1,NumPaths); y=randn(1,NumPaths); z=rand(1,NumPaths); for t=1:NumPaths if x(t)<=pup S(t)=S0*exp(m+s*y(t))*exp(-log(z(t))/lda); elseif x(t)>=1-pdown S(t)=S0*exp(m+s*y(t))*exp(log(z(t))/lda); else S(t)=S0*exp(m+s*y(t)); end end MeanS=mean(S); end
287 days ago
function [m,s]=estimateMultModelParams(stockTimeSeries,indexTimeSeries,LookbackPeriod,indexReturn,riskFreeRate) swr=stockTimeSeries(1:LookbackPeriod)./stockTimeSeries(2:LookbackPeriod+1)-1; iwr=indexTimeSeries(1:LookbackPeriod)./indexTimeSeries(2:LookbackPeriod+1)-1; covmatx=cov(swr,iwr); beta=covmatx(1,2)/covmatx(2,2); fcastR=riskFreeRate/LookbackPeriod+beta*(indexReturn/LookbackPeriod-riskFreeRate/LookbackPeriod); s=std(log(stockTimeSeries(1:LookbackPeriod)./stockTimeSeries(2:LookbackPeriod+1))); m=log(1+fcastR)-s^2/2; end If you define and input data into those variables, you can use it to estimate the probability density of a function of a variable subjected to normal distribution, with a mean of m, and a standard deviation of s. Here is an example: >>x=-4:.1:4; >>m=.06; >>s=.02; >>T=5; >>By=1./(1+(m+s*x)/2).^(2*T); ...



