相关日志
-
-
分享
Python——command
-
accumulation 2016-1-7 00:57
-
import os def dA(): os.system("python C:\\Users\SONY\A.py") def dB(): os.system("python C:\\Users\SONY\B.py") def dC(): os.system("python C:\\Users\SONY\C.py") #---------------------------------------------------------------- window = Tk() #设置能执行各个函数的Buttons stacy1 = Button(window, text = 'Trend', command = dA) stacy2 = Button(window, text = 'Piework Year', command = dB) stacy3 = Button(window, text = 'Piework Month', command = dC) stacy1.pack() stacy2.pack() stacy3.pack() window.mainloop()
-
个人分类: 金融工程|0 个评论
-
-
分享
Fortran——Black Scholes Model
-
accumulation 2015-5-1 14:59
-
Languages: BLACK_SCHOLES is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version . Related Data and Programs: COLORED_NOISE , a FORTRAN90 library which generates samples of noise obeying a 1/f^alpha power law. GNUPLOT , FORTRAN90 programs which illustrate how a program can write data and command files so that gnuplot can create plots of the program results. ORNSTEIN_UHLENBECK , a FORTRAN90 library which approximates solutions of the Ornstein-Uhlenbeck stochastic differential equation (SDE) using the Euler method and the Euler-Maruyama method. PCE_LEGENDRE , a MATLAB program which assembles the system matrix associated with a polynomal chaos expansion of a 2D stochastic PDE, using Legendre polynomials; PCE_ODE_HERMITE , a FORTRAN90 program which sets up a simple scalar ODE for exponential decay with an uncertain decay rate, using a polynomial chaos expansion in terms of Hermite polynomials. PINK_NOISE , a FORTRAN90 library which computes a "pink noise" signal obeying a 1/f power law. SDE , a FORTRAN90 library which illustrates the properties of stochastic differential equations, and common algorithms for their analysis, by Desmond Higham; STOCHASTIC_DIFFUSION , a FORTRAN90 library which implements several versions of a stochastic diffusivity coefficient. STOCHASTIC_GRADIENT_ND_NOISE , a MATLAB program which solves an optimization problem involving a functional over a system with stochastic noise. STOCHASTIC_RK , a FORTRAN90 library which applies a Runge-Kutta scheme to a stochastic differential equation. Author: Original MATLAB version by Desmond Higham; FORTRAN90 version by John Burkardt. Reference: Desmond Higham, Black-Scholes for Scientific Computing Students, Computing in Science and Engineering, Volume 6, Number 6, November/December 2004, pages 72-79. Source Code: black_scholes.f90 , the source code. black_scholes.sh , BASH commands to compile the source code. Examples and Tests: black_scholes_prb.f90 , a sample calling program. black_scholes_prb.sh , BASH commands to compile and run the sample program. black_scholes_prb_output.txt , the output file. asset_path_data.txt , the graphics data file. asset_path_commands.txt , the graphics data file. asset_path.png , a PNG image of the asset path, created by GNUPLOT. List of Routines: ASSET_PATH simulates the behavior of an asset price over time. BINOMIAL uses the binomial method for a European call. BSF evaluates the Black-Scholes formula for a European call. FORWARD uses the forward difference method to value a European call option. GET_UNIT returns a free FORTRAN unit number. MC uses Monte Carlo valuation on a European call. R8_NORMAL_01 returns a unit pseudonormal R8. R8_UNIFORM_01 returns a unit pseudorandom R8. R8VEC_NORMAL_01 returns a unit pseudonormal R8VEC. R8VEC_PRINT_PART prints "part" of an R8VEC. R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC. TIMESTAMP prints the current YMDHMS date as a time stamp.
-
个人分类: 金融工程|0 个评论
-
-
分享
分享:Spatial panel data models using Stata
-
区域经济爱好者 2013-7-26 21:05
-
来源:http://www.econometrics.it/?p=312 A new command for estimating and forecasting spatial panel data models using Stata is now available: xsmle . xsmle fits fixed or random effects spatial models for balanced panel data. See the mi prefix command in order to use xsmle in the unbalanced case. Consider the following general specification for the spatial panel data model: y i t = τ y i t − 1 + ρ W y i t + X i t β + D Z i t θ + a i + γ t + v i t v i t = λ E v i t + u i t where u i t is a normally distributed error term, W is the spatial matrix for the autoregressive component, D thespatial matrix for the spatially lagged independent variables, E the spatial matrix for the idiosyncratic errorcomponent. a i is the individual fixed or random effect and γ t is the time effect. xsmle fits the following nested models: i) The SAR model with lagged dependent variable ( θ = λ = 0 ) y i t = τ y i t − 1 + ρ W y i t + X i t β + a i + γ t + u i t , where the standard SAR model is obtained by setting τ = 0 . ii) The SDM model with lagged dependent variable ( λ = 0 ) y i t = τ y i t − 1 + ρ W y i t + X i t β + D Z i t θ + a i + γ t + u i t , where the standard SDM model is obtained by setting τ = 0 . xsmle allows to use a different weighting matrix for the spatially lagged dependent variable ( W ) and thespatially lagged regressors ( D ) together with a different sets of explanatory ( X i t ) and spatially laggedregressors ( Z i t ). The default is to use W = D and X i t = Z i t . iii) The SAC model ( θ = τ = 0 ) y i t = ρ W y i t + X i t β + a i + γ t + v i t , v i t = λ E v i t + u i t , for which xsmle allows to use a different weighting matrix for the spatially lagged dependent variable ( W ) and theerror term ( E ). iv) The SEM model ( ρ = θ = τ = 0 ) y i t = X i t β + a i + γ t + v i t , v i t = λ E v i t + u i t . v) The GSPRE model ( ρ = θ = τ = 0 ) y i t = X i t β + a i + v i t , a i = ϕ W a i + μ i , v i t = λ E v i t + u i t , where also the random effects have a spatial autoregressive form. The command was written together with Andrea Piano Mortari and Gordon Hughes . You may install it by typing net install xsmle, all from(http://www.econometrics.it/stata) in your Stata command bar. HTH, Federico
-
64 次阅读|0 个评论
-
-
分享
多重共线性处理
-
statalearning 2013-4-29 15:15
-
多重共线性的处理有两种方法:手动回归法和自动回归法 手动回归(适合解释变量较少的情况):首先要拟合Y对每一个变量的回归方程,从中选出拟合优度最高的方程作为基础方程,然后按照拟合优度由高到低逐一加入变量进行回归,根据t检验判断各个变量的取舍 自动回归(解释变量较多时):stata提供了直接进行分布回归的命令:stepwise :command 如输入命令:stepwise ,pe(0.05):regress Y X1 X2 X3 X4 X5 X6 就会去除多重共线性其中option有许多种,每种的分布回归的方式不同,具体用法可以查一下 希望对你有所帮助
-
0 个评论
-
-
分享
related commands of time series in Stata
-
vagrantwoo 2012-8-31 10:38
-
Data management tools and time series operators tsset Declare data to be time-series data tsfill Fill in gaps in time variable tsappend Add observations to a time-series dataset tsreport Report time-series aspects of a dataset or estimation sample tsrevar Time-series operator programming command haver Load data from Haver Analytics database rolling Rolling-window and recursive estimation datetime business calendars User-definable business calendars Univariate time series Estimators arfima Autoregressive fractionally integrated moving-average models arfima postestimation Postestimation tools for arfima arima ARIMA, ARMAX, and other dynamic regression models arima postestimation Postestimation tools for arima arch Autoregressive conditional heteroskedasticity (ARCH) family of estimators arch postestimation Postestimation tools for arch newey Regression with Newey–West standard errors newey postestimation Postestimation tools for newey prais Prais–Winsten and Cochrane–Orcutt regression prais postestimation Postestimation tools for prais ucm Unobserved-components model ucm postestimation Postestimation tools for ucm Timeseries smoothers and filters tsfilter bk Baxter–King time-series filter tsfilter bw Butterworth time-series filter tsfilter cf Christiano–Fitzgerald time-series filter tsfilter hp Hodrick–Prescott time-series filter tssmooth ma Moving-average filter tssmooth dexponential Double-exponential smoothing tssmooth exponential Single-exponential smoothing tssmooth hwinters Holt–Winters nonseasonal smoothing tssmooth shwinters Holt–Winters seasonal smoothing tssmooth nl Nonlinear filter Diagnostic tools corrgram Tabulate and graph autocorrelations xcorr Cross-correlogram for bivariate time series cumsp Cumulative spectral distribution pergram Periodogram psdensity Parametric spectral density estimation dfgls DF-GLS unit-root test dfuller Augmented Dickey–Fuller unit-root test pperron Phillips–Perron unit-root test regress postestimation time series Postestimation tools for regress with time series wntestb Bartlett’s periodogram-based test for white noise wntestq Portmanteau (Q) test for white noise autoregressive models Multivariate time series Estimators dfactor Dynamic-factor models dfactor postestimation Postestimation tools for dfactor mgarch ccc Constant conditional correlation multivariate GARCH models mgarch ccc postestimation Postestimation tools for mgarch ccc mgarch dcc Dynamic conditional correlation multivariate GARCH models mgarch dcc postestimation Postestimation tools for mgarch dcc mgarch dvech Diagonal vech multivariate GARCH models mgarch dvech postestimation Postestimation tools for mgarch dvech mgarch vcc Varying conditional correlation multivariate GARCH models mgarch vcc postestimation Postestimation tools for mgarch vcc sspace State-space models sspace postestimation Postestimation tools for sspace var Vector autoregressive models var postestimation Postestimation tools for var var svar Structural vector autoregressive models var svar postestimation Postestimation tools for svar varbasic Fit a simple VAR and graph IRFs or FEVDs varbasic postestimation Postestimation tools for varbasic vec Vector error-correction models vec postestimation Postestimation tools for vec Diagnostic tools varlmar Perform LM test for residual autocorrelation varnorm Test for normally distributed disturbances varsoc Obtain lag-order selection statistics for VARs and VECMs varstable Check the stability condition of VAR or SVAR estimates varwle Obtain Wald lag-exclusion statistics veclmar Perform LM test for residual autocorrelation vecnorm Test for normally distributed disturbances vecrank Estimate the cointegrating rank of a VECM vecstable Check the stability condition of VECM estimates Forecasting, inference, and interpretation irf create Obtain IRFs, dynamic-multiplier functions, and FEVDs fcast compute Compute dynamic forecasts of dependent variables vargranger Perform pairwise Granger causality tests Graphs and tables corrgram Tabulate and graph autocorrelations xcorr Cross-correlogram for bivariate time series pergram Periodogram irf graph Graph IRFs, dynamic-multiplier functions, and FEVDs irf cgraph Combine graphs of IRFs, dynamic-multiplier functions, and FEVDs irf ograph Graph overlaid IRFs, dynamic-multiplier functions, and FEVDs irf table Create tables of IRFs, dynamic-multiplier functions, and FEVDs irf ctable Combine tables of IRFs, dynamic-multiplier functions, and FEVDs fcast graph Graph forecasts of variables computed by fcast compute tsline Plot time-series data varstable Check the stability condition of VAR or SVAR estimates vecstable Check the stability condition of VECM estimates wntestb Bartlett’s periodogram-based test for white noise Results management tools irf add Add results from an IRF file to the active IRF file irf describe Describe an IRF file irf drop Drop IRF results from the active IRF file irf rename Rename an IRF result in an IRF file irf set Set the active IRF file
-
个人分类: stata|40 次阅读|0 个评论
GMT+8, 2025-12-25 00:30