楼主: Lisrelchen
1922 2

Mathematical Techniques in Finance: Tools for Incomplete Markets [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6306
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2015-3-13 00:40:14 |AI写论文
1论坛币
关键词:Mathematical mathematica Techniques Mathematic incomplete

沙发
Lisrelchen 发表于 2015-3-13 01:13:22
  1. function [val1, val2] = HARAmax1(X,XDistr,gama,CEqTolerance)
  2. %Copyright (c) 2001-2009 by Ales Cerny
  3. %usage [IP,alpha1] = HARAmax1(X,XDistr,gama,CertaintyEqTolerance)
  4. %computes IP and optimal portfolio for a single risky asset with excess
  5. %return X using normalized HARA utility (local risk aversion = 1)

  6. %************************************************************************%
  7. % HARAmax1.m - supplementary program to                                  %
  8. % Ales Cerny (2009) Mathematical Techniques in Finance (2nd ed.)         %
  9. % Princeton University Press http://press.princeton.edu/titles/9079.html %
  10. %************************************************************************%
  11.    
  12. % This code is provided 'as-is', without any express or implied warranty.  
  13. %
  14. % Permission is granted to anyone to use this code for any purpose,
  15. % subject to the following restrictions:
  16. %
  17. % 1. The origin of this code must not be misrepresented; you must not
  18. %    claim that you wrote the original code.
  19. % 2. Modified code versions must be plainly marked as such, and must not
  20. %    be misrepresented as being the original code.
  21. % 3. This notice may not be removed from any source distribution.

  22. % NOTICE TO STUDENTS: To avoid accusations of plagiarism, if you use this
  23. % code or its modifications in assessed work you should prepend it with a
  24. % note stating:
  25. %   "This is the original/modified version of the code HARAmax1.m by
  26. %    Ales Cerny (2009), Mathematical Techniques in Finance (2nd ed.),  
  27. %    Princeton University Press. The original version is available from
  28. %    http://www.martingales.info/mtfweb2".
  29. % A similar acknowledgement should appear prominently inside your written
  30. % report.

  31. alpha = 0;
  32. CEqPrecision=2*CEqTolerance;
  33. %*******************%
  34. %   the main loop   %
  35. %*******************%
  36. while abs(CEqPrecision) >= CEqTolerance;
  37.     wealth = 1 + X*alpha;
  38.     u = (wealth.^(1-gama))*XDistr';
  39.     du = (1-gama)*(X.*(wealth.^(-gama)))*XDistr';
  40.     ddu = gama*(gama-1)*((X.^2).*(wealth.^(-gama-1)))*XDistr';
  41.     CE = u.^(1/(1-gama));
  42.     CEqPrecision = -1/2/(1-gama)*du^2/u/ddu*gama*CE/(1+gama*(CE-1));
  43.     alpha = alpha - du/ddu;       
  44. end;
  45. val1=gama*(CE-1);
  46. val2=gama*alpha;
复制代码

藤椅
SCHWINY19 发表于 2016-5-12 16:02:10
function [val1, val2] = HARAmax1(X,XDistr,gama,CEqTolerance)
%Copyright (c) 2001-2009 by Ales Cerny
%usage [IP,alpha1] = HARAmax1(X,XDistr,gama,CertaintyEqTolerance)
%computes IP and optimal portfolio for a single risky asset with excess
%return X using normalized HARA utility (local risk aversion = 1)

%************************************************************************%
% HARAmax1.m - supplementary program to                                  %
% Ales Cerny (2009) Mathematical Techniques in Finance (2nd ed.)         %
% Princeton University Press http://press.princeton.edu/titles/9079.html %
%************************************************************************%
   
% This code is provided 'as-is', without any express or implied warranty.  
%
% Permission is granted to anyone to use this code for any purpose,
% subject to the following restrictions:
%
% 1. The origin of this code must not be misrepresented; you must not
%    claim that you wrote the original code.
% 2. Modified code versions must be plainly marked as such, and must not
%    be misrepresented as being the original code.
% 3. This notice may not be removed from any source distribution.

% NOTICE TO STUDENTS: To avoid accusations of plagiarism, if you use this
% code or its modifications in assessed work you should prepend it with a
% note stating:
%   "This is the original/modified version of the code HARAmax1.m by
%    Ales Cerny (2009), Mathematical Techniques in Finance (2nd ed.),  
%    Princeton University Press. The original version is available from
%    http://www.martingales.info/mtfweb2".
% A similar acknowledgement should appear prominently inside your written
% report.

alpha = 0;
CEqPrecision=2*CEqTolerance;
%*******************%
%   the main loop   %
%*******************%
while abs(CEqPrecision) >= CEqTolerance;
    wealth = 1 + X*alpha;
    u = (wealth.^(1-gama))*XDistr';
    du = (1-gama)*(X.*(wealth.^(-gama)))*XDistr';
    ddu = gama*(gama-1)*((X.^2).*(wealth.^(-gama-1)))*XDistr';
    CE = u.^(1/(1-gama));
    CEqPrecision = -1/2/(1-gama)*du^2/u/ddu*gama*CE/(1+gama*(CE-1));
    alpha = alpha - du/ddu;        
end;
val1=gama*(CE-1);
val2=gama*alpha;

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 04:56