Asymmetric distribution, Gauss curve
up vote
2
down vote
favorite
I want to create a positive and negative asymmetric distribution, as shown in the image, it will be possible to include the data (values) one by one to give the desired curve.
The WME is
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
begin{document}
newcommandgauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
begin{tikzpicture}[
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[every axis plot post/.append style={
mark=none,domain=-3.:3.,samples=100},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue] {gauss{0.}{1.}};
node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);
end{axis}
end{tikzpicture}
end{document}
tikz-pgf gauss
add a comment |
up vote
2
down vote
favorite
I want to create a positive and negative asymmetric distribution, as shown in the image, it will be possible to include the data (values) one by one to give the desired curve.
The WME is
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
begin{document}
newcommandgauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
begin{tikzpicture}[
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[every axis plot post/.append style={
mark=none,domain=-3.:3.,samples=100},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue] {gauss{0.}{1.}};
node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);
end{axis}
end{tikzpicture}
end{document}
tikz-pgf gauss
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to create a positive and negative asymmetric distribution, as shown in the image, it will be possible to include the data (values) one by one to give the desired curve.
The WME is
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
begin{document}
newcommandgauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
begin{tikzpicture}[
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[every axis plot post/.append style={
mark=none,domain=-3.:3.,samples=100},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue] {gauss{0.}{1.}};
node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);
end{axis}
end{tikzpicture}
end{document}
tikz-pgf gauss
I want to create a positive and negative asymmetric distribution, as shown in the image, it will be possible to include the data (values) one by one to give the desired curve.
The WME is
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
begin{document}
newcommandgauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
begin{tikzpicture}[
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[every axis plot post/.append style={
mark=none,domain=-3.:3.,samples=100},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue] {gauss{0.}{1.}};
node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);
end{axis}
end{tikzpicture}
end{document}
tikz-pgf gauss
tikz-pgf gauss
asked 2 hours ago
Samuel Diaz
2208
2208
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
This is only a partial answer since it is not clear to me what an asymmetric Gauss curve precisely is. This is more to discuss how to set this up in principle. So I am only going to discuss how to plot a deformed Gauss curve.
To this end, I'd like to convince you to use declare function
rather than the definition you use. In the example below, I am going to use
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));
Here Gauss
reduces to an ordinary Gaussian for u=0
, where x
is just the variable, y
defines the location of the maximum and z
the width. If you turn on a nontrivial u
, the Gaussian will get deformed.
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
pgfplotsset{height=4cm,width=8cm,compat=1.16}
begin{document}
begin{tikzpicture}[font=sffamily,
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));},
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[
every axis plot post/.append style={
mark=none,samples=101},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue,domain=-1:3] {Gauss(x,0,0.6,-0.4)};
draw[line width=1.5pt,dashed, black] (0,0) -- (0,{Gauss(0,0,0.6,-0.4)});
%node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (0.6,0) -- (0.6,{Gauss(0.6,0,0.6,-0.4)});
draw[line width=1.5pt,dashed, red] (-0.6,0) -- (-0.6,{Gauss(-0.6,0,0.6,-0.4)});
path (-0.6,0) coordinate (ML) (0.6,0) coordinate (MR) (0,0) coordinate (MM);
end{axis}
draw[latex-] (ML) to[out=-90,in=45] ++ (-0.6,-0.6) node[below left,inner
sep=1pt]{$langle Xrangle-Delta$};
draw[latex-] (MR) to[out=-90,in=135] ++ (0.6,-0.6) node[below right,inner
sep=1pt]{$langle Xrangle+Delta$};
draw[latex-] (MM) --++ (0,-0.6) node[below,inner
sep=1pt]{$langle Xrangle$};
end{tikzpicture}
end{document}
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
This is only a partial answer since it is not clear to me what an asymmetric Gauss curve precisely is. This is more to discuss how to set this up in principle. So I am only going to discuss how to plot a deformed Gauss curve.
To this end, I'd like to convince you to use declare function
rather than the definition you use. In the example below, I am going to use
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));
Here Gauss
reduces to an ordinary Gaussian for u=0
, where x
is just the variable, y
defines the location of the maximum and z
the width. If you turn on a nontrivial u
, the Gaussian will get deformed.
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
pgfplotsset{height=4cm,width=8cm,compat=1.16}
begin{document}
begin{tikzpicture}[font=sffamily,
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));},
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[
every axis plot post/.append style={
mark=none,samples=101},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue,domain=-1:3] {Gauss(x,0,0.6,-0.4)};
draw[line width=1.5pt,dashed, black] (0,0) -- (0,{Gauss(0,0,0.6,-0.4)});
%node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (0.6,0) -- (0.6,{Gauss(0.6,0,0.6,-0.4)});
draw[line width=1.5pt,dashed, red] (-0.6,0) -- (-0.6,{Gauss(-0.6,0,0.6,-0.4)});
path (-0.6,0) coordinate (ML) (0.6,0) coordinate (MR) (0,0) coordinate (MM);
end{axis}
draw[latex-] (ML) to[out=-90,in=45] ++ (-0.6,-0.6) node[below left,inner
sep=1pt]{$langle Xrangle-Delta$};
draw[latex-] (MR) to[out=-90,in=135] ++ (0.6,-0.6) node[below right,inner
sep=1pt]{$langle Xrangle+Delta$};
draw[latex-] (MM) --++ (0,-0.6) node[below,inner
sep=1pt]{$langle Xrangle$};
end{tikzpicture}
end{document}
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
add a comment |
up vote
3
down vote
This is only a partial answer since it is not clear to me what an asymmetric Gauss curve precisely is. This is more to discuss how to set this up in principle. So I am only going to discuss how to plot a deformed Gauss curve.
To this end, I'd like to convince you to use declare function
rather than the definition you use. In the example below, I am going to use
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));
Here Gauss
reduces to an ordinary Gaussian for u=0
, where x
is just the variable, y
defines the location of the maximum and z
the width. If you turn on a nontrivial u
, the Gaussian will get deformed.
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
pgfplotsset{height=4cm,width=8cm,compat=1.16}
begin{document}
begin{tikzpicture}[font=sffamily,
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));},
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[
every axis plot post/.append style={
mark=none,samples=101},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue,domain=-1:3] {Gauss(x,0,0.6,-0.4)};
draw[line width=1.5pt,dashed, black] (0,0) -- (0,{Gauss(0,0,0.6,-0.4)});
%node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (0.6,0) -- (0.6,{Gauss(0.6,0,0.6,-0.4)});
draw[line width=1.5pt,dashed, red] (-0.6,0) -- (-0.6,{Gauss(-0.6,0,0.6,-0.4)});
path (-0.6,0) coordinate (ML) (0.6,0) coordinate (MR) (0,0) coordinate (MM);
end{axis}
draw[latex-] (ML) to[out=-90,in=45] ++ (-0.6,-0.6) node[below left,inner
sep=1pt]{$langle Xrangle-Delta$};
draw[latex-] (MR) to[out=-90,in=135] ++ (0.6,-0.6) node[below right,inner
sep=1pt]{$langle Xrangle+Delta$};
draw[latex-] (MM) --++ (0,-0.6) node[below,inner
sep=1pt]{$langle Xrangle$};
end{tikzpicture}
end{document}
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
add a comment |
up vote
3
down vote
up vote
3
down vote
This is only a partial answer since it is not clear to me what an asymmetric Gauss curve precisely is. This is more to discuss how to set this up in principle. So I am only going to discuss how to plot a deformed Gauss curve.
To this end, I'd like to convince you to use declare function
rather than the definition you use. In the example below, I am going to use
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));
Here Gauss
reduces to an ordinary Gaussian for u=0
, where x
is just the variable, y
defines the location of the maximum and z
the width. If you turn on a nontrivial u
, the Gaussian will get deformed.
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
pgfplotsset{height=4cm,width=8cm,compat=1.16}
begin{document}
begin{tikzpicture}[font=sffamily,
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));},
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[
every axis plot post/.append style={
mark=none,samples=101},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue,domain=-1:3] {Gauss(x,0,0.6,-0.4)};
draw[line width=1.5pt,dashed, black] (0,0) -- (0,{Gauss(0,0,0.6,-0.4)});
%node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (0.6,0) -- (0.6,{Gauss(0.6,0,0.6,-0.4)});
draw[line width=1.5pt,dashed, red] (-0.6,0) -- (-0.6,{Gauss(-0.6,0,0.6,-0.4)});
path (-0.6,0) coordinate (ML) (0.6,0) coordinate (MR) (0,0) coordinate (MM);
end{axis}
draw[latex-] (ML) to[out=-90,in=45] ++ (-0.6,-0.6) node[below left,inner
sep=1pt]{$langle Xrangle-Delta$};
draw[latex-] (MR) to[out=-90,in=135] ++ (0.6,-0.6) node[below right,inner
sep=1pt]{$langle Xrangle+Delta$};
draw[latex-] (MM) --++ (0,-0.6) node[below,inner
sep=1pt]{$langle Xrangle$};
end{tikzpicture}
end{document}
This is only a partial answer since it is not clear to me what an asymmetric Gauss curve precisely is. This is more to discuss how to set this up in principle. So I am only going to discuss how to plot a deformed Gauss curve.
To this end, I'd like to convince you to use declare function
rather than the definition you use. In the example below, I am going to use
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));
Here Gauss
reduces to an ordinary Gaussian for u=0
, where x
is just the variable, y
defines the location of the maximum and z
the width. If you turn on a nontrivial u
, the Gaussian will get deformed.
documentclass[border=5mm]{standalone}
usepackage{pgfplots}
pgfplotsset{height=4cm,width=8cm,compat=1.16}
begin{document}
begin{tikzpicture}[font=sffamily,
declare function={Gauss(x,y,z,u)=1/(z*sqrt(2*pi))*exp(-((x-y+u*(x-y)*sign(x-y))^2)/(2*z^2));},
every pin edge/.style={latex-,line width=1.5pt},
every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=small}]
begin{axis}[
every axis plot post/.append style={
mark=none,samples=101},
clip=false,
axis y line=none,
axis x line*=bottom,
ymin=0,
xtick=empty,]
addplot[line width=1.5pt,blue,domain=-1:3] {Gauss(x,0,0.6,-0.4)};
draw[line width=1.5pt,dashed, black] (0,0) -- (0,{Gauss(0,0,0.6,-0.4)});
%node[pin=270:{$X=M_e=M_o$}] at (axis cs:0,0) {};
draw[line width=1.5pt,dashed, red] (0.6,0) -- (0.6,{Gauss(0.6,0,0.6,-0.4)});
draw[line width=1.5pt,dashed, red] (-0.6,0) -- (-0.6,{Gauss(-0.6,0,0.6,-0.4)});
path (-0.6,0) coordinate (ML) (0.6,0) coordinate (MR) (0,0) coordinate (MM);
end{axis}
draw[latex-] (ML) to[out=-90,in=45] ++ (-0.6,-0.6) node[below left,inner
sep=1pt]{$langle Xrangle-Delta$};
draw[latex-] (MR) to[out=-90,in=135] ++ (0.6,-0.6) node[below right,inner
sep=1pt]{$langle Xrangle+Delta$};
draw[latex-] (MM) --++ (0,-0.6) node[below,inner
sep=1pt]{$langle Xrangle$};
end{tikzpicture}
end{document}
edited 24 mins ago
answered 2 hours ago
marmot
78k487166
78k487166
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
add a comment |
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@ marmot They are two separate graphs, one that leans to the right and the other to the left, known as negative skew and positive skew. en.wikipedia.org/wiki/Skewness
– Samuel Diaz
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
@SamuelDiaz Thanks for the link! But as far as I can see it does not really give you a unique parametrization of these deformed Gaussians, does it?
– marmot
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
Correct, you have to keep in mind that you meet that average < average < mode or average > median > fashion.
– Samuel Diaz
1 hour ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
@SamuelDiaz I added a possible way how you could use this.
– marmot
43 mins ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461758%2fasymmetric-distribution-gauss-curve%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown