{"id":593,"date":"2014-04-21T15:15:56","date_gmt":"2014-04-21T20:15:56","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=593"},"modified":"2014-04-21T15:15:56","modified_gmt":"2014-04-21T20:15:56","slug":"fractal-brownian-function-on-2d-grid-with-a-generic-voss-algorithm","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2014\/04\/21\/fractal-brownian-function-on-2d-grid-with-a-generic-voss-algorithm\/","title":{"rendered":"Fractal Brownian function on 2D grid with a generic Voss algorithm"},"content":{"rendered":"<table style=\"color: #000000;\" summary=\"page for voss2g\" width=\"100%\">\n<tbody>\n<tr>\n<td>voss2g<\/td>\n<td align=\"right\">R Documentation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"color: #000000;\">Fractal Brownian function on 2D grid with a generic Voss algorithm<\/h2>\n<h3 style=\"color: #000000;\">Description<\/h3>\n<p style=\"color: #000000;\"><code>voss2g()<\/code>\u00a0function generates realizations of a fractal Brownian function on uniform 2D grid (FBF(x,y)) with a generic version of the Voss algorithm (random sequential additions).<\/p>\n<h3 style=\"color: #000000;\">Usage<\/h3>\n<pre style=\"color: #000000;\">voss2g(p=cbind(n=0.5^-seq(0,7)+1, \n               s=dchisq(seq(0,7), df=2)), \n       center=TRUE)\n<\/pre>\n<h3 style=\"color: #000000;\">Arguments<\/h3>\n<table style=\"color: #000000;\" summary=\"R argblock\">\n<tbody>\n<tr valign=\"top\">\n<td><code>p<\/code><\/td>\n<td>a matrix of parameters:<br \/>\n<code>nrow(p)<\/code>\u00a0a number of iterations;<br \/>\n<code>p[,\"n\"]<\/code>\u00a0a number of partition points in the iteration process;<br \/>\n<code>p[,\"s\"]<\/code>\u00a0a standard deviation of normal pseudorandom additions;<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><code>center<\/code><\/td>\n<td>logical; if\u00a0<code>center=TRUE<\/code>\u00a0then the\u00a0<code>y<\/code>-coordinates of prefractal points will be centered.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"color: #000000;\">Details<\/h3>\n<p style=\"color: #000000;\">The Voss algorithm on 2D grid is based on an iterative partitioning of the initial domain into smaller subdomains by bilinear interpolation of additional points.<\/p>\n<p style=\"color: #000000;\">At each iteration, all values of the fractal Brownian function get normal pseudorandom additions with zero mean and standard deviation, which depends on the iteration index\u00a0<code>s[i]<\/code>.<\/p>\n<p style=\"color: #000000;\">By default, the iterative distribution of standard deviation in the generic version of the Voss algorithm is equal to the probability density of the chi-square distribution with 2 degrees of freedom:\u00a0<code>s[i] &lt;- dchisq(i, df=2)<\/code>.<\/p>\n<h3 style=\"color: #000000;\">Value<\/h3>\n<p style=\"color: #000000;\">A list of Cartesian coordinates of prefractal points.<\/p>\n<h3 style=\"color: #000000;\">Author(s)<\/h3>\n<p style=\"color: #000000;\">Pavel V. Moskalev<\/p>\n<h3 style=\"color: #000000;\">References<\/h3>\n<p style=\"color: #000000;\">Shitov V.V. and Moskalev P.V. Modification of the Voss algorithm for simulation of the internal structure of a porous medium \/\/Technical Physics, Vol.50, No.2 (2005), pp.141-145.<\/p>\n<h3 style=\"color: #000000;\">See Also<\/h3>\n<p style=\"color: #000000;\">voss1g, voss2d<\/p>\n<h3 style=\"color: #000000;\">Examples<\/h3>\n<pre style=\"color: #000000;\"># Example 1: FBF(x,y) with a s[i]=dchisq(i,df=2)\nset.seed(20120522)\nvoss &lt;- voss2g()\nimage(voss, xlab=\"x\", ylab=\"y\",\n      main=\"FBF(x,y) with a s[i]=dchisq(i,df=2)\")\ncontour(voss, levels=0, add=TRUE)\n\n# Example 2: FBF(x,y) with a s[i]=dlnorm(i,sdlog=1)\nset.seed(20120522)\nvoss &lt;- voss2g(p=cbind(n=0.5^-seq(0,7)+1, \n                       s=dlnorm(seq(0,7), sdlog=1)))\nimage(voss, xlab=\"x\", ylab=\"y\",\n      main=\"FBF(x,y) with a s[i]=dlnorm(i,sdlog=1)\")\ncontour(voss, levels=0, add=TRUE)\n\n# Example 3: FBF(x,y) with a s[i]=df(i,df1=7,df2=7)\nset.seed(20120522)\nvoss &lt;- voss2g(p=cbind(n=0.5^-seq(0,7)+1, \n                       s=df(seq(0,7), df1=7, df2=7)))\nimage(voss, xlab=\"x\", ylab=\"y\",\n      main=\"FBF(x,y) with a s[i]=df(i,df1=5,df2=5)\")\ncontour(voss, levels=0, add=TRUE)\n<\/pre>\n<h3 style=\"color: #000000;\">Results<\/h3>\n<pre style=\"color: #000000;\">R version 3.0.2 (2013-09-25) -- \"Frisbee Sailing\"\nCopyright (C) 2013 The R Foundation for Statistical Computing\nPlatform: x86_64-unknown-linux-gnu (64-bit)\n\nR is free software and comes with ABSOLUTELY NO WARRANTY.\nYou are welcome to redistribute it under certain conditions.\nType 'license()' or 'licence()' for distribution details.\n\nR is a collaborative project with many contributors.\nType 'contributors()' for more information and\n'citation()' on how to cite R or R packages in publications.\n\nType 'demo()' for some demos, 'help()' for on-line help, or\n'help.start()' for an HTML browser interface to help.\nType 'q()' to quit R.\n\n&gt; library(Voss)\nLoading required package: fields\nLoading required package: spam\nSpam version 0.29-3 (2013-04-23) is loaded.\nType 'help( Spam)' or 'demo( spam)' for a short introduction \nand overview of this package.\nHelp for individual functions is also obtained by adding the\nsuffix '.spam' to the function name, e.g. 'help( chol.spam)'.\n\nAttaching package: 'spam'\n\nThe following objects are masked from 'package:base':\n\n    backsolve, forwardsolve\n\nLoading required package: maps\n&gt; png(filename=\"\/home\/oogasawa\/snapshot\/RGM3\/R_CC\/result\/Voss\/voss2g.Rd_%03d_medium.png\", width=480, height=480)\n&gt; ### Name: voss2g\n&gt; ### Title: Fractal Brownian function on 2D grid with a generic Voss\n&gt; ###   algorithm\n&gt; ### Aliases: voss2g\n&gt; \n&gt; ### ** Examples\n&gt; \n&gt; # Example 1: FBF(x,y) with a s[i]=dchisq(i,df=2)\n&gt; set.seed(20120522)\n&gt; voss &lt;- voss2g()\n&gt; image(voss, xlab=\"x\", ylab=\"y\",\n+       main=\"FBF(x,y) with a s[i]=dchisq(i,df=2)\")\n&gt; contour(voss, levels=0, add=TRUE)\n&gt; \n&gt; # Example 2: FBF(x,y) with a s[i]=dlnorm(i,sdlog=1)\n&gt; set.seed(20120522)\n&gt; voss &lt;- voss2g(p=cbind(n=0.5^-seq(0,7)+1, \n+                        s=dlnorm(seq(0,7), sdlog=1)))\n&gt; image(voss, xlab=\"x\", ylab=\"y\",\n+       main=\"FBF(x,y) with a s[i]=dlnorm(i,sdlog=1)\")\n&gt; contour(voss, levels=0, add=TRUE)\n&gt; \n&gt; # Example 3: FBF(x,y) with a s[i]=df(i,df1=7,df2=7)\n&gt; set.seed(20120522)\n&gt; voss &lt;- voss2g(p=cbind(n=0.5^-seq(0,7)+1, \n+                        s=df(seq(0,7), df1=7, df2=7)))\n&gt; image(voss, xlab=\"x\", ylab=\"y\",\n+       main=\"FBF(x,y) with a s[i]=df(i,df1=5,df2=5)\")\n&gt; contour(voss, levels=0, add=TRUE)\n&gt; \n&gt; \n&gt; \n&gt; \n&gt; \n&gt; dev.off()\nnull device \n          1 \n&gt;\n<\/pre>\n<p>&nbsp;<\/p>\n<table style=\"color: #000000;\">\n<tbody>\n<tr>\n<td><a style=\"color: #708090;\" href=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_001_large.png\"><img decoding=\"async\" src=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_001_medium.png\" alt=\"\" \/><\/a><a style=\"color: #708090;\" href=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_002_large.png\"><img decoding=\"async\" src=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_002_medium.png\" alt=\"\" \/><\/a><a style=\"color: #708090;\" href=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_003_large.png\"><img decoding=\"async\" src=\"http:\/\/rgm3.lab.nig.ac.jp\/RGM-files\/R_CC\/result\/Voss\/voss2g.Rd_003_medium.png\" alt=\"\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>voss2g R Documentation Fractal Brownian function on 2D grid with a generic Voss algorithm Description voss2g()\u00a0function generates realizations of a fractal Brownian function on uniform&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-593","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=593"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/593\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}