Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Please experts help me to check this code and comment if error please

1 visualización (últimos 30 días)
Nirajan Khatri
Nirajan Khatri el 24 de Sept. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
clear all;
clc;
N = 1000;
% standard normal distribution mean=0 and variance =1
norm_mean=0;
norm_var=1;
%generating random variable with standard normal distribution
r1= norm_mean+sqrt(norm_var)*randn(1,N)
figure;
hist(r1)
r2= norm_mean+sqrt(norm_var)*randn(1,N);
figure;
hist(r2)
%u= copularndn('Gaussian',r1,r2)
figure
scatterhist(r1,r2)
%normal distribution PDF
xPDF= normpdf(r1,norm_mean,sqrt(norm_var));
figure;
hist(xPDF)
yPDF =normpdf(r2,norm_mean,sqrt(norm_var));
figure;
hist(yPDF)
%calculate normal distribution cdf
pd = makedist('Normal',norm_mean,sqrt(norm_var));
%compute the cdf values for the standard normal distribution at the values
%in random variables
y1 = cdf(pd,r1);
figure;
hist(y1)
y2 = cdf(pd,r2);
figure;
hist(y2)
figure
scatterhist(y1,y2)
%calculating correlation
rho= corr(y1(:),y2(:)) %rho is correlation coefficient
%calculating Gaussian/Normal copula
u=copularnd('Gaussian',rho,N)
figure;
scatterhist(u(:,1),u(:,2))
[SL: formatted the code as code]

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by