Reference to non-existent field
Afficher commentaires plus anciens
Hello i'm new to matlab, this is my error "Reference to non-existent field 'sigmaV'."
This is my code:
%Script tests the particle filter
%simulation parameters
%[sigma sigmaN mu F/V_end]
param_real=[.25 0.0001 .18 1];
sigma=param_real(1); %asset volatility
delta=param_real(2); %measurement noise
mu=param_real(3); %asset drift
F0=1; %debt
V_end=F0/param_real(4); %end-of-sample pseudo-leverage
r=.05; %riskfree rate
dt=1/250; %observation frequency
T=10; %beginning maturity
t=9; %end-of-sample maturity
%number of simulated paths
Npath=1;
randn('state',0);
%%%%%%%%%%%%%%%%
%Simulate paths%
%%%%%%%%%%%%%%%%
for m=1:Npath
[S(:,m),AssetValue(:,m),mat]=SimMerton_Equity(V_end,dt,mu,r,sigma,F0,T,t,delta);
end
%%%%%%%%%%%%%%%%%%%%%%%
%set filter parameters%
%%%%%%%%%%%%%%%%%%%%%%%
samplesize=length(mat);
F=ones(samplesize,1)*F0;
modelparam.dt=dt;
modelparam.r=r;
modelparam.sigma=sigma/20;
modelparam.mu=mu;
modelparam.delta=delta;
%number of particles
M=1000;
R=1000;
%random number seed to filter
seed=0;
%generate prior
Prior=log(AssetValue(1))+randn(M,1)*.1;
%%%%%%%%%%%%
%Run Filter%
%%%%%%%%%%%%
tic
[L,V]=feval('LocalizedFilter',modelparam,Prior,R,seed,S(1:100),F(1:100),mat(1:100));
toc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%loglikelihood from transformed data method%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
L3=Merton_loglvec([modelparam.sigmaV modelparam.mu],S(1:100),r,F(1:100),mat(1:100),modelparam.dt);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Scope Variables and Generate Names dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!