mel | R Documentation |
Produces an ellipse based on 1 of 4 possible formulations: 1-Eigenvalues, 2-Hysteresis Coefs, 3-Amplitudes and 4-Algebraic Coefs.
mel(method=1,seed=NULL,...)
mel1(cx=32,cy=39,rote.deg=2,semi.major=7,semi.minor=0.23,
phase.angle=0,n.points=24,period=24,sd.x=0,sd.y=0)
mel2(cx=32,cy=39,b.x=6.99,b.y=0.244,retention=0.23,
phase.angle=0,n.points=24,period=24,sd.x=0,sd.y=0)
mel3(cx=32,cy=39,ampx=6.99,ampy=0.335,lag=2.888,phase.angle=0,
n.points=24,period=24,sd.x=0,sd.y=0)
mel4(x2=0.002293,xy=-.06960,y2=0.9976,x=2.567,y=-75.58,int=1432.7,
phase.angle=0,n.points=24,period=24,sd.x=0,sd.y=0)
method |
selects which of the functions |
seed |
integer, the starting seed. |
... |
arguments to the functions |
cx |
Center of input x. |
cy |
Center of output y. |
phase.angle |
defines the starting point of the ellipse. Does not change ellipse shape. |
rote.deg |
Theta, angle of rotation. In degrees. Only used if |
semi.major |
Half length of major axis. Only used if |
semi.minor |
Half length of minor axis. Only used if |
b.x |
Saturation point x coordinate. Only used if |
b.y |
Saturation point y coordinate. Only used if |
retention |
another ellipse parameter used if |
ampx |
The range of the ellipse input values divided by 2. Only used if |
ampy |
The range of the ellipse output values divided by 2. Only used if |
lag |
The number of points between the location where the input reaches its maximum value and where the output reaches its maximum value.
Lag is therefore dependent on the value chosen for period. Only used if |
x2 |
Coefficient on x^2 in the equation found in details. Only used if |
xy |
Coefficient on xy in the equation found in details. Only used if |
y2 |
Coefficient on y^2 in the equation found in details. Only used if |
x |
Coefficient on x in the equation found in details. Only used if |
y |
Coefficient on y in the equation found in details. Only used if |
int |
Coefficient on the intercept in the equation found in details. Only used if |
n.points |
Number of points on ellipse. Equally spaced around circumference of ellipse/period. |
period |
Number of points required to make a full loop around the ellipse. |
sd.x |
optional number specifying a normally distributed standard deviation for x. |
sd.y |
optional number specifying a normally distributed standard deviation for y. |
All of the four methods can be used to specify a series of points that make up an ellipse. The function mel
uses parameters to form an ellipse and find derived variables such as area, lag, retention, and coercion.
Optionally, normally distributed random variation can be introduced in both the x and y directions. The first method is useful alongside the nls, lm and direct fitting methods,
while the second is comparable to the harmonic2 ellipse fitting method. The third method for mel is included because it is the easiest to interpret. Finally the fourth method uses the equation 0=a0+a1*x^2+a2*xy+a3*y^2+a4*x+a5*y to form an ellipse. The "a" parameters here are marked as int, x2, xy, y2, x and y in the function itself.
mel returns an object of class ellipsemake
.
values |
the nine fundamental parameters (cx,cy,rote.deg,semi.major,semi.minor,b.x,b.y,a,phase.angle) of which only four or five are used along with the four derived parameters (area, lag, retention, coercion). |
method |
the method used. |
x |
the input x. |
y |
the output y. |
Spencer Maynes, Fan Yang, and Anne Parkhurst.
Yang, F. and A. Parkhurst, Efficient Estimation of Elliptical Hysteresis. (submitted)
fel
for fitting observations that form an ellipse and creating an ellipsefit
object, plot.ellipsefit
for plotting an ellipsefit
object.
summary.ellipsefit
for summarizing an ellipsefit
object, and plot.ellipsesummary
for plotting an ellipsesummary
object.
ellipseA <- mel(method=3,cx=35, cy=39, ampx=7, ampy=2, lag=3, sd.x=0.2,sd.y=0.04)
ellipseA.fit <- fel(ellipseA$x,ellipseA$y)
plot(ellipseA.fit,xlab="Input",ylab="Output",main="Simulated Ellipse",
putNumber=TRUE)
boot.ellipseA.fit <- fel(ellipseA$x,ellipseA$y, boot=TRUE, seed=231)
plot(boot.ellipseA.fit,xlab="Input",ylab="Output",
main="Bootstrapped Ellipse",values="ellipse.all")
ellipse.eig <- mel(semi.major=7,semi.minor=4,rote.deg=30)
ellip.eigen.fit <- fel(ellipse.eig$x,ellipse.eig$y)
ellip.eigen.fit$Estimates
plot(ellip.eigen.fit,main="Ellipse from Eigenvalue Parameters",
show=c("semi.major","semi.minor","rote.deg"),values="ellipse")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.